home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Programming / Programming Tools / MacMan. / Manual < prev    next >
MacBinary  |  1986-10-10  |  438.4 KB  |  [MAND/TOOL]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: Manual

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
100% file MacBinary II, inited, Mon Dec 31 19:02:45 1979, modified Fri Oct 10 09:19:13 1986, creator 'TOOL', type 'MAND', 448359 bytes "Manual" , at 0x6d7e7 348 bytes resource default (weak)
99% file data default
66% TrID TTComp archive compressed (bin-4K) default (weak)
33% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[MAND]
macFileCreator[TOOL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 4d 61 6e 75 61 6c | 00 00 00 00 00 00 00 00 |..Manual|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4d 41 4e 44 54 4f 4f | 4c 01 00 00 00 00 00 00 |.MANDTOO|L.......|
|00000050| 00 00 00 00 06 d7 67 00 | 00 01 5c 8e f4 57 25 9b |......g.|..\..W%.|
|00000060| b2 b0 d1 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 7a e3 00 00 |........|....z...|
|00000080| 20 20 20 20 20 20 20 20 | 20 20 20 20 0d 0d 20 20 | | .. |
|00000090| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000000a0| 0d 0d 20 20 54 68 69 73 | 20 69 73 20 61 20 75 73 |.. This| is a us|
|000000b0| 65 72 20 73 75 70 70 6f | 72 74 65 64 20 70 72 6f |er suppo|rted pro|
|000000c0| 64 75 63 74 2c 20 57 65 | 20 65 6e 63 6f 75 72 61 |duct, We| encoura|
|000000d0| 67 65 20 79 6f 75 20 74 | 6f 20 70 61 73 73 20 69 |ge you t|o pass i|
|000000e0| 74 20 61 6c 6f 6e 67 0d | 20 20 74 6f 20 6f 74 68 |t along.| to oth|
|000000f0| 65 72 73 2e 20 49 66 20 | 79 6f 75 20 66 69 6e 64 |ers. If |you find|
|00000100| 20 20 4d 41 43 4d 41 4e | 20 20 74 6f 20 62 65 20 | MACMAN| to be |
|00000110| 6f 66 20 75 73 65 2c 20 | 73 75 67 67 65 73 74 65 |of use, |suggeste|
|00000120| 64 20 64 6f 6e 61 74 69 | 6f 6e 20 6f 66 20 20 0d |d donati|on of .|
|00000130| 20 20 24 31 30 20 20 69 | 73 20 73 74 72 6f 6e 67 | $10 i|s strong|
|00000140| 6c 79 20 61 70 70 72 65 | 63 69 61 74 65 64 2e 20 |ly appre|ciated. |
|00000150| 57 69 74 68 20 79 6f 75 | 72 20 73 75 70 70 6f 72 |With you|r suppor|
|00000160| 74 20 77 65 20 63 61 6e | 20 63 6f 6e 74 69 6e 75 |t we can| continu|
|00000170| 65 20 74 6f 20 0d 20 20 | 64 65 76 65 6c 6f 70 20 |e to . |develop |
|00000180| 75 73 65 66 75 6c 20 73 | 6f 66 74 77 61 72 65 20 |useful s|oftware |
|00000190| 74 6f 6f 6c 73 2e 20 0d | 0d 20 20 20 20 20 20 20 |tools. .|. |
|000001a0| 20 20 20 20 53 65 6e 64 | 20 63 6f 6d 6d 65 6e 74 | Send| comment|
|000001b0| 73 2c 20 71 75 65 73 74 | 69 6f 6e 73 20 61 6e 64 |s, quest|ions and|
|000001c0| 20 64 6f 6e 61 74 69 6f | 6e 20 74 6f 20 3a 20 0d | donatio|n to : .|
|000001d0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000001e0| 20 20 20 20 46 53 20 53 | 6f 66 74 77 61 72 65 20 | FS S|oftware |
|000001f0| 44 65 76 65 6c 6f 70 6d | 65 6e 74 20 47 72 6f 75 |Developm|ent Grou|
|00000200| 70 0d 09 09 20 20 20 20 | 20 20 20 20 20 20 20 20 |p... | |
|00000210| 20 20 20 20 20 20 43 6f | 6d 70 75 74 65 72 20 53 | Co|mputer S|
|00000220| 63 69 65 6e 63 65 20 44 | 65 70 61 72 74 6d 65 6e |cience D|epartmen|
|00000230| 74 0d 09 09 20 20 20 20 | 20 20 20 20 20 20 20 20 |t... | |
|00000240| 20 20 20 20 20 20 20 20 | 4f 72 65 67 6f 6e 20 53 | |Oregon S|
|00000250| 74 61 74 65 20 55 6e 69 | 76 65 72 73 69 74 79 0d |tate Uni|versity.|
|00000260| 09 09 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00000270| 20 20 20 20 20 20 20 20 | 43 6f 72 76 61 6c 6c 69 | |Corvalli|
|00000280| 73 2c 20 4f 52 20 39 37 | 33 33 30 0d 09 09 09 20 |s, OR 97|330.... |
|00000290| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000002a0| 20 20 20 20 20 20 20 35 | 30 33 2d 37 35 34 2d 33 | 5|03-754-3|
|000002b0| 32 37 33 0d 09 09 09 09 | 09 09 20 20 20 20 20 0d |273.....|.. .|
|000002c0| 20 20 20 20 20 20 20 20 | 20 20 20 4d 41 43 4d 41 | | MACMA|
|000002d0| 4e 27 53 20 49 4e 46 4f | 52 4d 41 54 49 4f 4e 20 |N'S INFO|RMATION |
|000002e0| 41 52 45 20 50 41 52 54 | 53 20 4f 46 20 49 4e 53 |ARE PART|S OF INS|
|000002f0| 49 44 45 20 4d 41 43 49 | 4e 54 4f 53 48 20 20 20 |IDE MACI|NTOSH |
|00000300| 0d 09 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00000310| 57 48 49 43 48 20 49 53 | 20 43 4f 50 59 52 49 47 |WHICH IS| COPYRIG|
|00000320| 48 54 45 44 20 42 59 20 | 41 50 50 4c 45 20 43 4f |HTED BY |APPLE CO|
|00000330| 4d 50 55 54 45 52 53 20 | 49 4e 43 2e 20 20 0d 0d |MPUTERS |INC. ..|
|00000340| 09 20 20 20 20 20 0d 5c | 20 49 6e 69 74 52 65 73 |. .\| InitRes|
|00000350| 6f 75 72 63 65 73 0d 31 | 0d 46 55 4e 43 54 49 4f |ources.1|.FUNCTIO|
|00000360| 4e 20 49 6e 69 74 52 65 | 73 6f 75 72 63 65 73 20 |N InitRe|sources |
|00000370| 3a 20 49 4e 54 45 47 45 | 52 3b 0d 0d 49 6e 69 74 |: INTEGE|R;..Init|
|00000380| 52 65 73 6f 75 72 63 65 | 73 20 69 73 20 63 61 6c |Resource|s is cal|
|00000390| 6c 65 64 20 62 79 20 74 | 68 65 20 73 79 73 74 65 |led by t|he syste|
|000003a0| 6d 20 77 68 63 6e 20 69 | 74 20 73 74 61 72 74 73 |m whcn i|t starts|
|000003b0| 20 75 70 2c 20 61 6e 64 | 20 73 68 6f 75 6c 64 20 | up, and| should |
|000003c0| 6e 6f 74 0d 62 65 20 63 | 61 6c 6c 65 64 20 62 79 |not.be c|alled by|
|000003d0| 20 74 68 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e | the app|lication|
|000003e0| 2e 20 49 74 20 69 6e 69 | 74 69 61 6c 69 7a 65 73 |. It ini|tializes|
|000003f0| 20 74 68 65 20 52 65 73 | 6f 75 72 63 65 20 4d 61 | the Res|ource Ma|
|00000400| 6e 61 67 65 72 2c 0d 6f | 70 65 6e 73 20 74 68 65 |nager,.o|pens the|
|00000410| 20 73 79 73 74 65 6d 20 | 72 65 73 6f 75 72 63 65 | system |resource|
|00000420| 20 66 69 6c 65 2c 20 72 | 65 61 64 73 20 74 68 65 | file, r|eads the|
|00000430| 20 72 65 73 6f 75 72 63 | 65 20 6d 61 70 20 66 72 | resourc|e map fr|
|00000440| 6f 6d 20 74 68 65 20 66 | 69 6c 65 20 0d 69 6e 74 |om the f|ile .int|
|00000450| 6f 20 6d 65 6d 6f 72 79 | 2c 20 61 6e 64 20 72 65 |o memory|, and re|
|00000460| 74 75 72 6e 73 20 61 20 | 72 65 66 65 72 65 6e 63 |turns a |referenc|
|00000470| 65 20 6e 75 6d 62 65 72 | 20 66 6f 72 20 74 68 65 |e number| for the|
|00000480| 20 66 69 6c 65 2e 0d 0d | 28 6e 6f 74 65 29 20 0d | file...|(note) .|
|00000490| 09 54 68 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |.The app|lication|
|000004a0| 20 64 6f 65 73 6e 27 74 | 20 6e 65 65 64 20 74 68 | doesn't| need th|
|000004b0| 65 20 72 65 66 65 72 65 | 6e 63 65 20 6e 75 6d 62 |e refere|nce numb|
|000004c0| 65 72 20 66 6f 72 20 74 | 68 65 20 0d 09 73 79 73 |er for t|he ..sys|
|000004d0| 74 65 6d 20 72 65 73 6f | 75 72 63 65 20 66 69 6c |tem reso|urce fil|
|000004e0| 65 2c 20 62 65 63 61 75 | 73 65 20 65 76 65 72 79 |e, becau|se every|
|000004f0| 20 52 65 73 6f 75 72 63 | 65 20 4d 61 6e 61 67 65 | Resourc|e Manage|
|00000500| 72 20 0d 09 72 6f 75 74 | 69 6e 65 20 74 68 61 74 |r ..rout|ine that|
|00000510| 20 68 61 73 20 61 20 72 | 65 66 65 72 65 6e 63 65 | has a r|eference|
|00000520| 20 6e 75 6d 62 65 72 20 | 61 73 20 61 20 70 61 72 | number |as a par|
|00000530| 61 6d 65 74 65 72 20 0d | 09 69 6e 74 65 72 70 72 |ameter .|.interpr|
|00000540| 65 74 73 20 af 20 74 6f | 20 6d 65 61 6e 20 74 68 |ets . to| mean th|
|00000550| 65 20 73 79 73 74 65 6d | 20 72 65 73 6f 75 72 63 |e system| resourc|
|00000560| 65 20 66 69 6c 65 2e 0d | 09 0d 0d 5c 20 52 73 72 |e file..|...\ Rsr|
|00000570| 63 5a 6f 6e 65 49 6e 69 | 74 0d 31 0d 50 52 4f 43 |cZoneIni|t.1.PROC|
|00000580| 45 44 55 52 45 20 52 73 | 72 63 5a 6f 6e 65 49 6e |EDURE Rs|rcZoneIn|
|00000590| 69 74 3b 0d 0d 52 73 72 | 63 5a 6f 6e 65 49 6e 69 |it;..Rsr|cZoneIni|
|000005a0| 74 20 69 73 20 63 61 6c | 6c 65 64 20 61 75 74 6f |t is cal|led auto|
|000005b0| 6d 61 74 69 63 61 6c 6c | 79 20 77 68 65 6e 20 79 |maticall|y when y|
|000005c0| 6f 75 72 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |our appl|ication |
|000005d0| 73 74 61 72 74 73 20 75 | 70 2c 0d 74 6f 20 69 6e |starts u|p,.to in|
|000005e0| 69 74 69 61 6c 69 7a 65 | 20 74 68 65 20 72 65 73 |itialize| the res|
|000005f0| 6f 75 72 63 65 20 6d 61 | 70 20 72 65 61 64 20 66 |ource ma|p read f|
|00000600| 72 6f 6d 20 74 68 65 20 | 73 79 73 74 65 6d 20 72 |rom the |system r|
|00000610| 65 73 6f 75 72 63 65 20 | 66 69 6c 65 3b 0d 6e 6f |esource |file;.no|
|00000620| 72 6d 61 6c 6c 79 20 79 | 6f 75 27 6c 6c 20 68 61 |rmally y|ou'll ha|
|00000630| 76 65 20 6e 6f 20 6e 65 | 65 64 20 74 6f 20 63 61 |ve no ne|ed to ca|
|00000640| 6c 6c 20 69 74 20 64 69 | 72 65 63 74 6c 79 2e 20 |ll it di|rectly. |
|00000650| 20 49 74 20 22 63 6c 65 | 61 6e 73 20 75 70 22 20 | It "cle|ans up" |
|00000660| 61 66 74 65 72 0d 61 6e | 79 20 72 65 73 6f 75 72 |after.an|y resour|
|00000670| 63 65 20 61 63 63 65 73 | 73 20 74 68 61 74 20 6d |ce acces|s that m|
|00000680| 61 79 20 68 61 76 65 20 | 62 65 65 6e 20 64 6f 6e |ay have |been don|
|00000690| 65 20 62 79 20 61 20 70 | 72 65 76 69 6f 75 73 20 |e by a p|revious |
|000006a0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 2e 20 20 0d 46 |applicat|ion. .F|
|000006b0| 69 72 73 74 20 69 74 20 | 63 6c 6f 73 65 73 20 61 |irst it |closes a|
|000006c0| 6c 6c 20 6f 70 65 6e 20 | 72 65 73 6f 75 72 63 65 |ll open |resource|
|000006d0| 20 66 69 6c 65 73 20 65 | 78 63 65 70 74 20 74 68 | files e|xcept th|
|000006e0| 65 20 73 79 73 74 65 6d | 20 72 65 73 6f 75 72 63 |e system| resourc|
|000006f0| 65 0d 66 69 6c 65 2e 20 | 20 54 68 65 6e 2c 20 66 |e.file. | Then, f|
|00000700| 6f 72 20 65 76 65 72 79 | 20 73 79 73 74 65 6d 20 |or every| system |
|00000710| 72 65 73 6f 75 72 63 65 | 20 74 68 61 74 20 77 61 |resource| that wa|
|00000720| 73 20 72 65 61 64 20 69 | 6e 74 6f 20 74 68 65 20 |s read i|nto the |
|00000730| 0d 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 68 65 61 |.applica|tion hea|
|00000740| 70 20 28 74 68 61 74 20 | 69 73 2c 20 77 68 6f 73 |p (that |is, whos|
|00000750| 65 20 72 65 73 53 79 73 | 48 65 61 70 20 61 74 74 |e resSys|Heap att|
|00000760| 72 69 62 75 74 65 20 69 | 73 20 af 29 2c 20 69 74 |ribute i|s .), it|
|00000770| 0d 72 65 70 6c 61 63 65 | 73 20 74 68 65 20 68 61 |.replace|s the ha|
|00000780| 6e 64 6c 65 20 74 6f 20 | 74 68 61 74 20 72 65 73 |ndle to |that res|
|00000790| 6f 75 72 63 65 20 69 6e | 20 74 68 65 20 72 65 73 |ource in| the res|
|000007a0| 6f 75 72 63 65 20 6d 61 | 70 20 77 69 74 68 20 4e |ource ma|p with N|
|000007b0| 49 4c 2e 0d 54 68 69 73 | 20 6c 65 74 73 20 74 68 |IL..This| lets th|
|000007c0| 65 20 52 65 73 6f 75 72 | 63 65 20 4d 61 6e 61 67 |e Resour|ce Manag|
|000007d0| 65 72 20 6b 6e 6f 77 20 | 74 68 61 74 20 74 68 65 |er know |that the|
|000007e0| 20 72 65 73 6f 75 72 63 | 65 20 77 69 6c 6c 20 68 | resourc|e will h|
|000007f0| 61 76 65 20 74 6f 20 62 | 65 0d 72 65 61 64 20 69 |ave to b|e.read i|
|00000800| 6e 20 61 67 61 69 6e 20 | 28 73 69 6e 63 65 20 74 |n again |(since t|
|00000810| 68 65 20 70 72 65 76 69 | 6f 75 73 20 61 70 70 6c |he previ|ous appl|
|00000820| 69 63 61 74 69 6f 6e 20 | 68 65 61 70 20 69 73 20 |ication |heap is |
|00000830| 6e 6f 20 6c 6f 6e 67 65 | 72 0d 61 72 6f 75 6e 64 |no longe|r.around|
|00000840| 29 2e 20 20 0d 0d 0d 5c | 20 43 72 65 61 74 65 52 |). ...\| CreateR|
|00000850| 65 73 46 69 6c 65 0d 31 | 0d 50 52 4f 43 45 44 55 |esFile.1|.PROCEDU|
|00000860| 52 45 20 43 72 65 61 74 | 65 52 65 73 46 69 6c 65 |RE Creat|eResFile|
|00000870| 20 28 66 69 6c 65 4e 61 | 6d 65 3a 20 53 74 72 32 | (fileNa|me: Str2|
|00000880| 35 35 29 3b 0d 0d 43 72 | 65 61 74 65 52 65 73 46 |55);..Cr|eateResF|
|00000890| 69 6c 65 20 63 72 65 61 | 74 65 73 20 61 20 72 65 |ile crea|tes a re|
|000008a0| 73 6f 75 72 63 65 20 66 | 69 6c 65 20 63 6f 6e 74 |source f|ile cont|
|000008b0| 61 69 6e 69 6e 67 20 6e | 6f 20 72 65 73 6f 75 72 |aining n|o resour|
|000008c0| 63 65 20 64 61 74 61 20 | 6f 72 0d 63 6f 70 79 20 |ce data |or.copy |
|000008d0| 6f 66 20 74 68 65 20 66 | 69 6c 65 27 73 20 64 69 |of the f|ile's di|
|000008e0| 72 65 63 74 6f 72 79 20 | 65 6e 74 72 79 2e 20 20 |rectory |entry. |
|000008f0| 49 66 20 74 68 65 72 65 | 27 73 20 6e 6f 20 66 69 |If there|'s no fi|
|00000900| 6c 65 20 61 74 20 61 6c | 6c 20 77 69 74 68 20 74 |le at al|l with t|
|00000910| 68 65 20 0d 67 69 76 65 | 6e 20 6e 61 6d 65 2c 20 |he .give|n name, |
|00000920| 69 74 20 61 6c 73 6f 20 | 63 72 65 61 74 65 73 20 |it also |creates |
|00000930| 61 6e 20 65 6d 70 74 79 | 20 64 61 74 61 20 66 6f |an empty| data fo|
|00000940| 72 6b 20 66 6f 72 20 74 | 68 65 20 66 69 6c 65 2e |rk for t|he file.|
|00000950| 20 20 49 66 20 0d 74 68 | 65 72 65 27 73 20 61 6c | If .th|ere's al|
|00000960| 72 65 61 64 79 20 61 20 | 72 65 73 6f 75 72 63 65 |ready a |resource|
|00000970| 20 66 69 6c 65 20 77 69 | 74 68 20 74 68 65 20 67 | file wi|th the g|
|00000980| 69 76 65 6e 20 6e 61 6d | 65 20 28 74 68 61 74 20 |iven nam|e (that |
|00000990| 69 73 2c 20 61 0d 72 65 | 73 6f 75 72 63 65 20 66 |is, a.re|source f|
|000009a0| 6f 72 6d 20 74 68 61 74 | 20 69 73 6e 27 74 20 65 |orm that| isn't e|
|000009b0| 6d 70 74 79 29 2c 20 43 | 72 65 61 74 65 52 65 73 |mpty), C|reateRes|
|000009c0| 46 69 6c 65 20 77 69 6c | 6c 20 64 6f 20 6e 6f 74 |File wil|l do not|
|000009d0| 68 69 6e 67 20 61 6e 64 | 20 74 68 65 20 0d 52 65 |hing and| the .Re|
|000009e0| 73 45 72 72 6f 72 20 66 | 75 6e 63 74 69 6f 6e 20 |sError f|unction |
|000009f0| 77 69 6c 6c 20 72 65 74 | 75 72 6e 20 61 6e 20 61 |will ret|urn an a|
|00000a00| 70 70 72 6f 70 72 69 61 | 74 65 20 4f 70 65 72 61 |ppropria|te Opera|
|00000a10| 74 69 6e 67 20 53 79 73 | 74 65 6d 20 72 65 73 75 |ting Sys|tem resu|
|00000a20| 6c 74 20 0d 63 6f 64 65 | 2e 0d 0d 28 6e 6f 74 65 |lt .code|...(note|
|00000a30| 29 0d 09 42 65 66 6f 72 | 65 20 79 6f 75 20 63 61 |)..Befor|e you ca|
|00000a40| 6e 20 77 6f 72 6b 20 77 | 69 74 68 20 74 68 65 20 |n work w|ith the |
|00000a50| 72 65 73 6f 75 72 63 65 | 20 66 69 6c 65 2c 20 79 |resource| file, y|
|00000a60| 6f 75 20 6e 65 65 64 20 | 74 6f 0d 09 6f 70 65 6e |ou need |to..open|
|00000a70| 20 69 74 20 77 69 74 68 | 20 4f 70 65 6e 52 65 73 | it with| OpenRes|
|00000a80| 46 69 6c 65 2e 0d 09 0d | 0d 5c 20 4f 70 65 6e 52 |File....|.\ OpenR|
|00000a90| 65 73 46 69 6c 65 0d 31 | 0d 46 55 4e 43 54 49 4f |esFile.1|.FUNCTIO|
|00000aa0| 4e 20 4f 70 65 6e 52 65 | 73 46 69 6c 65 20 28 66 |N OpenRe|sFile (f|
|00000ab0| 69 6c 65 4e 61 6d 65 3a | 20 53 74 72 32 35 35 29 |ileName:| Str255)|
|00000ac0| 20 3a 20 49 4e 54 45 47 | 45 52 3b 0d 0d 4f 70 65 | : INTEG|ER;..Ope|
|00000ad0| 6e 52 65 73 46 69 6c 65 | 20 6f 70 65 6e 73 20 74 |nResFile| opens t|
|00000ae0| 68 65 20 72 65 73 6f 75 | 72 63 65 20 66 69 6c 65 |he resou|rce file|
|00000af0| 20 68 61 76 69 6e 67 20 | 74 68 65 20 67 69 76 65 | having |the give|
|00000b00| 6e 20 6e 61 6d 65 20 61 | 6e 64 20 6d 61 6b 65 73 |n name a|nd makes|
|00000b10| 20 69 74 0d 74 68 65 20 | 63 75 72 72 65 6e 74 20 | it.the |current |
|00000b20| 72 65 73 6f 75 72 63 65 | 20 66 69 6c 65 2e 20 20 |resource| file. |
|00000b30| 49 74 20 72 65 61 64 73 | 20 74 68 65 20 72 65 73 |It reads| the res|
|00000b40| 6f 75 72 63 65 20 6d 61 | 70 20 66 72 6f 6d 20 74 |ource ma|p from t|
|00000b50| 68 65 20 66 69 6c 65 20 | 0d 69 6e 74 6f 20 6d 65 |he file |.into me|
|00000b60| 6d 6f 72 79 20 61 6e 64 | 20 72 65 74 75 72 6e 73 |mory and| returns|
|00000b70| 20 61 20 72 65 66 65 72 | 65 6e 63 65 20 6e 75 6d | a refer|ence num|
|00000b80| 62 65 72 20 66 6f 72 20 | 74 68 65 20 66 69 6c 65 |ber for |the file|
|00000b90| 2e 20 20 49 74 20 61 6c | 73 6f 20 72 65 61 64 73 |. It al|so reads|
|00000ba0| 0d 69 6e 20 65 76 65 72 | 79 20 72 65 73 6f 75 72 |.in ever|y resour|
|00000bb0| 63 65 20 77 68 6f 73 65 | 20 72 65 73 50 72 65 6c |ce whose| resPrel|
|00000bc0| 6f 61 64 20 61 74 74 72 | 69 62 75 74 65 20 69 73 |oad attr|ibute is|
|00000bd0| 20 73 65 74 2e 20 20 49 | 66 20 74 68 65 20 72 65 | set. I|f the re|
|00000be0| 73 6f 75 72 63 65 20 0d | 66 69 6c 65 20 69 73 20 |source .|file is |
|00000bf0| 61 6c 72 65 61 64 79 20 | 6f 70 65 6e 2c 20 69 74 |already |open, it|
|00000c00| 20 64 6f 65 73 6e 27 74 | 20 6d 61 6b 65 20 69 74 | doesn't| make it|
|00000c10| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 72 65 73 | the cur|rent res|
|00000c20| 6f 75 72 63 65 20 66 69 | 6c 65 3b 20 69 74 0d 73 |ource fi|le; it.s|
|00000c30| 69 6d 70 6c 79 20 72 65 | 74 75 72 6e 73 20 74 68 |imply re|turns th|
|00000c40| 65 20 72 65 66 65 72 65 | 6e 63 65 20 6e 75 6d 62 |e refere|nce numb|
|00000c50| 65 72 2e 0d 0d 28 6e 6f | 74 65 29 0d 09 59 6f 75 |er...(no|te)..You|
|00000c60| 20 64 6f 6e 27 74 20 68 | 61 76 65 20 74 6f 20 63 | don't h|ave to c|
|00000c70| 61 6c 6c 20 4f 70 65 6e | 52 65 73 46 69 6c 65 20 |all Open|ResFile |
|00000c80| 74 6f 20 6f 70 65 6e 20 | 74 68 65 20 73 79 73 74 |to open |the syst|
|00000c90| 65 6d 0d 09 52 65 73 6f | 75 72 63 65 20 66 69 6c |em..Reso|urce fil|
|00000ca0| 65 20 6f 72 20 74 68 65 | 20 61 70 70 6c 69 63 61 |e or the| applica|
|00000cb0| 74 69 6f 6e 27 73 20 72 | 65 73 6f 75 72 63 65 20 |tion's r|esource |
|00000cc0| 66 69 6c 65 2c 20 62 65 | 63 61 75 73 65 0d 09 74 |file, be|cause..t|
|00000cd0| 68 65 79 27 72 65 20 6f | 70 65 6e 65 64 20 77 68 |hey're o|pened wh|
|00000ce0| 65 6e 20 74 68 65 20 73 | 79 73 74 65 6d 20 61 6e |en the s|ystem an|
|00000cf0| 64 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |d the ap|plicatio|
|00000d00| 6e 20 73 74 61 72 74 0d | 09 75 70 2c 20 72 65 73 |n start.|.up, res|
|00000d10| 70 65 63 74 69 76 65 6c | 79 2e 20 20 54 6f 20 67 |pectivel|y. To g|
|00000d20| 65 74 20 74 68 65 20 72 | 65 66 65 72 65 6e 63 65 |et the r|eference|
|00000d30| 20 6e 75 6d 62 65 72 20 | 6f 66 20 74 68 65 20 0d | number |of the .|
|00000d40| 09 61 70 70 6c 69 63 61 | 74 69 6f 6e 27 73 20 72 |.applica|tion's r|
|00000d50| 65 73 6f 75 72 63 65 20 | 66 69 6c 65 2c 20 79 6f |esource |file, yo|
|00000d60| 75 20 63 61 6e 20 63 61 | 6c 6c 20 43 75 72 52 65 |u can ca|ll CurRe|
|00000d70| 73 46 69 6c 65 0d 09 61 | 66 74 65 72 20 74 68 65 |sFile..a|fter the|
|00000d80| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 73 74 61 | applica|tion sta|
|00000d90| 72 74 73 20 75 70 20 28 | 62 65 66 6f 72 65 20 79 |rts up (|before y|
|00000da0| 6f 75 20 6f 70 65 6e 20 | 61 6e 79 0d 09 6f 74 68 |ou open |any..oth|
|00000db0| 65 72 20 72 65 73 6f 75 | 72 63 65 20 66 69 6c 65 |er resou|rce file|
|00000dc0| 29 2e 0d 09 0d 49 66 20 | 74 68 65 20 66 69 6c 65 |)....If |the file|
|00000dd0| 20 63 61 6e 27 74 20 62 | 65 20 6f 70 65 6e 65 64 | can't b|e opened|
|00000de0| 2c 20 4f 70 65 6e 52 65 | 73 ec 69 6c 65 20 77 69 |, OpenRe|s.ile wi|
|00000df0| 6c 6c 20 72 65 74 75 72 | 6e 20 2d 31 20 61 6e 64 |ll retur|n -1 and|
|00000e00| 20 74 68 65 0d 52 65 73 | 45 72 72 6f 72 20 66 75 | the.Res|Error fu|
|00000e10| 6e 63 74 69 6f 6e 20 77 | 69 6c 6c 20 72 65 74 75 |nction w|ill retu|
|00000e20| 72 6e 20 61 6e 20 61 70 | 70 72 6f 70 72 69 61 74 |rn an ap|propriat|
|00000e30| 65 20 4f 70 65 72 61 74 | 69 6e 67 20 53 79 73 74 |e Operat|ing Syst|
|00000e40| 65 6d 20 72 65 73 75 6c | 74 0d 63 6f 64 65 2e 20 |em resul|t.code. |
|00000e50| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 61 6e | For exa|mple, an|
|00000e60| 20 65 72 72 6f 72 20 6f | 63 63 75 72 73 20 69 66 | error o|ccurs if|
|00000e70| 20 74 68 65 72 65 27 73 | 20 6e 6f 20 72 65 73 6f | there's| no reso|
|00000e80| 75 72 63 65 20 66 69 6c | 65 20 77 69 74 68 20 0d |urce fil|e with .|
|00000e90| 74 68 65 20 67 69 76 65 | 6e 20 6e 61 6d 65 2e 0d |the give|n name..|
|00000ea0| 0d 5c 20 43 6c 6f 73 65 | 52 65 73 46 69 6c 65 0d |.\ Close|ResFile.|
|00000eb0| 31 0d 50 52 4f 43 45 44 | 55 52 45 20 43 6c 6f 73 |1.PROCED|URE Clos|
|00000ec0| 65 52 65 73 46 69 6c 65 | 20 28 72 65 66 4e 75 6d |eResFile| (refNum|
|00000ed0| 3a 20 49 4e 54 45 47 45 | 52 29 3b 0d 0d 47 69 76 |: INTEGE|R);..Giv|
|00000ee0| 65 6e 20 74 68 65 20 72 | 65 66 65 72 65 6e 63 65 |en the r|eference|
|00000ef0| 20 6e 75 6d 62 65 72 20 | 6f 66 20 61 20 72 65 73 | number |of a res|
|00000f00| 6f 75 72 63 65 20 66 69 | 6c 65 2c 20 43 6c 6f 73 |ource fi|le, Clos|
|00000f10| 65 52 65 73 46 69 6c 65 | 20 64 6f 65 73 20 74 68 |eResFile| does th|
|00000f20| 65 20 0d 66 6f 6c 6c 6f | 77 69 6e 67 3a 0d 0d 09 |e .follo|wing:...|
|00000f30| 2d 20 75 70 64 61 74 65 | 73 20 74 68 65 20 72 65 |- update|s the re|
|00000f40| 73 6f 75 72 63 65 20 66 | 69 6c 65 20 62 79 20 63 |source f|ile by c|
|00000f50| 61 6c 6c 69 6e 67 20 74 | 68 65 20 55 70 64 61 74 |alling t|he Updat|
|00000f60| 65 52 65 73 46 69 6c 65 | 20 70 72 6f 63 65 64 75 |eResFile| procedu|
|00000f70| 72 65 0d 09 0d 09 2d 20 | 66 6f 72 20 65 61 63 68 |re....- |for each|
|00000f80| 20 72 65 73 6f 75 72 63 | 65 20 69 6e 20 74 68 65 | resourc|e in the|
|00000f90| 20 72 65 73 6f 75 72 63 | 65 20 66 69 6c 65 2c 20 | resourc|e file, |
|00000fa0| 72 65 6c 65 61 73 65 73 | 20 74 68 65 20 6d 65 6d |releases| the mem|
|00000fb0| 6f 72 79 20 69 74 0d 09 | 20 20 6f 63 63 75 70 69 |ory it..| occupi|
|00000fc0| 65 73 20 62 79 20 63 61 | 6c 6c 69 6e 67 20 74 68 |es by ca|lling th|
|00000fd0| 65 20 52 65 6c 65 61 73 | 65 52 65 73 6f 75 72 63 |e Releas|eResourc|
|00000fe0| 65 20 70 72 6f 63 65 64 | 75 72 65 0d 09 0d 09 2d |e proced|ure....-|
|00000ff0| 20 72 65 6c 65 61 73 65 | 73 20 74 68 65 20 6d 65 | release|s the me|
|00001000| 6d 6f 72 79 20 6f 63 63 | 75 70 69 65 64 20 62 79 |mory occ|upied by|
|00001010| 20 74 68 65 20 72 65 73 | 6f 75 72 63 65 20 6d 61 | the res|ource ma|
|00001020| 70 0d 09 0d 09 2d 20 63 | 6c 6f 73 65 73 20 74 68 |p....- c|loses th|
|00001030| 65 20 72 65 73 6f 75 72 | 63 65 20 66 69 6c 65 20 |e resour|ce file |
|00001040| 0d 09 0d 49 66 20 74 68 | 65 72 65 27 73 20 6e 6f |...If th|ere's no|
|00001050| 20 72 65 73 6f 75 72 63 | 65 20 66 69 6c 65 20 6f | resourc|e file o|
|00001060| 70 65 6e 20 77 69 74 68 | 20 74 68 65 20 67 69 76 |pen with| the giv|
|00001070| 65 6e 20 72 65 66 65 72 | 65 6e 63 65 20 6e 75 6d |en refer|ence num|
|00001080| 62 65 72 2c 0d 43 6c 6f | 73 65 52 65 73 46 69 6c |ber,.Clo|seResFil|
|00001090| 65 20 77 69 6c 6c 20 64 | 6f 20 6e 6f 74 68 69 6e |e will d|o nothin|
|000010a0| 67 20 61 6e 64 20 74 68 | 65 20 52 65 73 45 72 72 |g and th|e ResErr|
|000010b0| 6f 72 20 66 75 6e 63 74 | 69 6f 6e 20 77 69 6c 6c |or funct|ion will|
|000010c0| 20 72 65 74 75 72 6e 20 | 74 68 65 20 0d 72 65 73 | return |the .res|
|000010d0| 75 6c 74 20 63 6f 64 65 | 20 72 65 73 46 4e 6f 74 |ult code| resFNot|
|000010e0| 46 6f 75 6e 64 2e 20 20 | 41 20 72 65 66 4e 75 6d |Found. |A refNum|
|000010f0| 20 6f 66 20 af 20 72 65 | 70 72 65 73 65 6e 74 73 | of . re|presents|
|00001100| 20 74 68 65 20 73 79 73 | 74 65 6d 20 72 65 73 6f | the sys|tem reso|
|00001110| 75 72 63 65 0d 66 69 6c | 65 2c 20 62 75 74 20 69 |urce.fil|e, but i|
|00001120| 66 20 79 6f 75 20 61 73 | 6b 20 74 6f 20 63 6c 6f |f you as|k to clo|
|00001130| 73 65 20 74 68 69 73 20 | 66 69 6c 65 2c 20 43 6c |se this |file, Cl|
|00001140| 6f 73 65 52 65 73 46 69 | 6c 65 20 66 69 72 73 74 |oseResFi|le first|
|00001150| 20 63 6c 6f 73 65 73 20 | 61 6c 6c 20 0d 6f 74 68 | closes |all .oth|
|00001160| 65 72 20 6f 70 65 6e 20 | 72 65 73 6f 75 72 63 65 |er open |resource|
|00001170| 20 66 69 6c 65 73 2e 0d | 0d 41 20 43 6c 6f 73 65 | files..|.A Close|
|00001180| 52 65 73 46 69 6c 65 20 | 6f 66 20 65 76 65 72 79 |ResFile |of every|
|00001190| 20 6f 70 65 6e 20 72 65 | 73 6f 75 72 63 65 20 66 | open re|source f|
|000011a0| 69 6c 65 20 65 78 63 65 | 70 74 20 74 68 65 20 73 |ile exce|pt the s|
|000011b0| 79 73 74 65 6d 20 72 65 | 73 6f 75 72 63 65 0d 66 |ystem re|source.f|
|000011c0| 69 6c 65 20 69 73 20 64 | 6f 6e 65 20 61 75 74 6f |ile is d|one auto|
|000011d0| 6d 61 74 69 63 61 6c 6c | 79 20 77 68 65 6e 20 74 |maticall|y when t|
|000011e0| 68 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 74 |he appli|cation t|
|000011f0| 65 72 6d 69 6e 61 74 65 | 73 2e 20 20 53 6f 20 79 |erminate|s. So y|
|00001200| 6f 75 20 0d 6f 6e 6c 79 | 20 6e 65 65 64 20 74 6f |ou .only| need to|
|00001210| 20 63 61 6c 6c 20 43 6c | 6f 73 65 52 65 73 46 69 | call Cl|oseResFi|
|00001220| 6c 65 20 69 66 20 79 6f | 75 20 77 61 6e 74 20 74 |le if yo|u want t|
|00001230| 6f 20 63 6c 6f 73 65 20 | 74 68 65 20 73 79 73 74 |o close |the syst|
|00001240| 65 6d 20 72 65 73 6f 75 | 72 63 65 0d 66 69 6c 65 |em resou|rce.file|
|00001250| 2c 20 6f 72 20 69 66 20 | 79 6f 75 20 77 61 6e 74 |, or if |you want|
|00001260| 20 74 6f 20 63 6c 6f 73 | 65 20 61 6e 79 20 72 65 | to clos|e any re|
|00001270| 73 6f 75 72 63 65 20 66 | 69 6c 65 20 62 65 66 6f |source f|ile befo|
|00001280| 72 65 20 74 68 65 20 61 | 70 70 6c 69 63 61 74 69 |re the a|pplicati|
|00001290| 6f 6e 0d 74 65 72 6d 69 | 6e 61 74 65 73 2e 0d 0d |on.termi|nates...|
|000012a0| 0d 5c 20 52 65 73 45 72 | 72 6f 72 0d 31 0d 46 55 |.\ ResEr|ror.1.FU|
|000012b0| 4e 43 54 49 4f 4e 20 52 | 65 73 45 72 72 6f 72 20 |NCTION R|esError |
|000012c0| 3a 20 49 4e 54 45 47 45 | 52 3b 0d 0d 43 61 6c 6c |: INTEGE|R;..Call|
|000012d0| 65 64 20 61 66 74 65 72 | 20 6f 6e 65 20 6f 66 20 |ed after| one of |
|000012e0| 74 68 65 20 76 61 72 69 | 6f 75 73 20 52 65 73 6f |the vari|ous Reso|
|000012f0| 75 72 63 65 20 4d 61 6e | 61 67 65 72 20 72 6f 75 |urce Man|ager rou|
|00001300| 74 69 6e 65 73 20 74 68 | 61 74 20 6d 61 79 0d 72 |tines th|at may.r|
|00001310| 65 73 75 6c 74 20 69 6e | 20 61 6e 20 65 72 72 6f |esult in| an erro|
|00001320| 72 20 63 6f 6e 64 69 74 | 69 6f 6e 2c 20 52 65 73 |r condit|ion, Res|
|00001330| 45 72 72 6f 72 20 72 65 | 74 75 72 6e 73 20 61 20 |Error re|turns a |
|00001340| 72 65 73 75 6c 74 20 63 | 6f 64 65 20 0d 69 64 65 |result c|ode .ide|
|00001350| 6e 74 69 66 79 69 6e 67 | 20 74 68 65 20 65 72 72 |ntifying| the err|
|00001360| 6f 72 2c 20 69 66 20 61 | 6e 79 2e 20 20 49 66 20 |or, if a|ny. If |
|00001370| 6e 6f 20 65 72 72 6f 72 | 20 6f 63 63 75 72 72 65 |no error| occurre|
|00001380| 64 2c 20 69 74 20 72 65 | 74 75 72 6e 73 20 74 68 |d, it re|turns th|
|00001390| 65 20 0d 72 65 73 75 6c | 74 20 63 6f 64 65 0d 0d |e .resul|t code..|
|000013a0| 09 43 4f 4e 53 54 20 20 | 6e 6f 45 72 72 20 3d 20 |.CONST |noErr = |
|000013b0| af 3b 20 7b 6e 6f 20 65 | 72 72 6f 72 7d 0d 09 0d |.; {no e|rror}...|
|000013c0| 49 66 20 61 6e 20 65 72 | 72 6f 72 20 6f 63 63 75 |If an er|ror occu|
|000013d0| 72 72 65 64 20 61 74 20 | 74 68 65 20 4f 70 65 72 |rred at |the Oper|
|000013e0| 61 74 69 6e 67 20 53 79 | 73 74 65 6d 20 6c 65 76 |ating Sy|stem lev|
|000013f0| 65 6c 2c 20 69 74 20 72 | 65 74 75 72 6e 73 20 61 |el, it r|eturns a|
|00001400| 6e 20 0d 4f 70 65 72 61 | 74 69 6e 67 20 53 79 73 |n .Opera|ting Sys|
|00001410| 74 65 6d 20 72 65 73 75 | 6c 74 20 63 6f 64 65 2c |tem resu|lt code,|
|00001420| 20 73 75 63 68 20 61 73 | 20 74 68 65 20 46 69 6c | such as| the Fil|
|00001430| 65 20 4d 61 6e 61 67 65 | 72 20 22 64 69 73 6b 20 |e Manage|r "disk |
|00001440| 49 2f 4f 22 20 65 72 72 | 6f 72 0d 6f 72 20 74 68 |I/O" err|or.or th|
|00001450| 65 20 4d 65 6d 6f 72 79 | 20 4d 61 6e 61 67 65 72 |e Memory| Manager|
|00001460| 20 22 6f 75 74 20 6f 66 | 20 6d 65 6d 6f 72 79 22 | "out of| memory"|
|00001470| 20 65 72 72 6f 72 2e 20 | 20 28 53 65 65 20 74 68 | error. | (See th|
|00001480| 65 20 46 69 6c 65 20 4d | 61 6e 61 67 65 72 20 61 |e File M|anager a|
|00001490| 6e 64 20 0d 4d 65 6d 6f | 72 79 20 4d 61 6e 61 67 |nd .Memo|ry Manag|
|000014a0| 65 72 20 6d 61 6e 75 61 | 6c 73 20 66 6f 72 20 61 |er manua|ls for a|
|000014b0| 20 6c 69 73 74 20 6f 66 | 20 74 68 65 20 72 65 73 | list of| the res|
|000014c0| 75 6c 74 20 63 6f 64 65 | 73 2e 29 20 20 49 66 20 |ult code|s.) If |
|000014d0| 61 6e 20 65 72 72 6f 72 | 0d 68 61 70 70 65 6e 65 |an error|.happene|
|000014e0| 64 20 61 74 20 74 68 65 | 20 52 65 73 6f 75 72 63 |d at the| Resourc|
|000014f0| 65 20 4d 61 6e 61 67 65 | 72 20 6c 65 76 65 6c 2c |e Manage|r level,|
|00001500| 20 52 65 73 45 72 72 6f | 72 20 72 65 74 75 72 6e | ResErro|r return|
|00001510| 73 20 6f 6e 65 20 6f 66 | 20 74 68 65 20 0d 66 6f |s one of| the .fo|
|00001520| 6c 6c 6f 77 69 6e 67 20 | 72 65 73 75 6c 74 20 63 |llowing |result c|
|00001530| 6f 64 65 73 3a 0d 0d 09 | 43 4f 4e 53 54 09 72 65 |odes:...|CONST.re|
|00001540| 73 4e 6f 74 46 6f 75 6e | 64 20 20 3d 09 2d 31 39 |sNotFoun|d =.-19|
|00001550| 32 3b 09 7b 72 65 73 6f | 75 72 63 65 20 6e 6f 74 |2;.{reso|urce not|
|00001560| 20 66 6f 75 6e 64 7d 0d | 09 09 72 65 73 46 4e 6f | found}.|..resFNo|
|00001570| 74 46 6f 75 6e 64 20 3d | 09 2d 31 39 33 3b 09 7b |tFound =|.-193;.{|
|00001580| 72 65 73 6f 75 63 65 20 | 66 69 6c 65 20 6e 6f 74 |resouce |file not|
|00001590| 20 66 6f 75 6e 64 7d 0d | 09 09 61 64 64 52 65 73 | found}.|..addRes|
|000015a0| 46 61 69 6c 65 64 20 3d | 20 20 2d 31 39 34 3b 09 |Failed =| -194;.|
|000015b0| 7b 41 64 64 52 65 73 6f | 75 72 63 65 20 66 61 69 |{AddReso|urce fai|
|000015c0| 6c 65 64 7d 0d 09 09 72 | 6d 76 52 65 73 46 61 69 |led}...r|mvResFai|
|000015d0| 6c 65 64 20 3d 20 20 2d | 31 39 36 3b 09 7b 52 6d |led = -|196;.{Rm|
|000015e0| 76 65 52 65 73 6f 75 72 | 63 65 20 66 61 69 6c 65 |veResour|ce faile|
|000015f0| 64 7d 0d 09 09 0d 45 61 | 63 68 20 72 6f 75 74 69 |d}....Ea|ch routi|
|00001600| 6e 65 20 64 65 73 63 72 | 69 70 74 69 6f 6e 20 74 |ne descr|iption t|
|00001610| 65 6c 6c 73 20 77 68 69 | 63 68 20 65 72 72 6f 72 |ells whi|ch error|
|00001620| 73 20 6d 61 79 20 6f 63 | 63 75 72 20 66 6f 72 20 |s may oc|cur for |
|00001630| 74 68 61 74 20 72 6f 75 | 74 69 6e 65 2e 0d 59 6f |that rou|tine..Yo|
|00001640| 75 20 63 61 6e 20 61 6c | 73 6f 20 63 68 65 63 6b |u can al|so check|
|00001650| 20 66 6f 72 20 61 6e 20 | 65 72 72 6f 72 20 61 66 | for an |error af|
|00001660| 74 65 72 20 73 79 73 74 | 65 6d 20 73 74 61 72 74 |ter syst|em start|
|00001670| 75 70 2c 20 77 68 69 63 | 68 20 63 61 6c 6c 73 0d |up, whic|h calls.|
|00001680| 49 6e 69 74 52 65 73 6f | 75 72 63 65 73 2c 20 61 |InitReso|urces, a|
|00001690| 6e 64 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 73 |nd appli|cation s|
|000016a0| 74 61 72 74 75 70 2c 20 | 77 68 69 63 68 20 6f 70 |tartup, |which op|
|000016b0| 65 6e 73 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 |ens the |applicat|
|000016c0| 69 6f 6e 27 73 20 0d 72 | 65 73 6f 75 72 63 65 20 |ion's .r|esource |
|000016d0| 66 69 6c 65 2e 0d 0d 0d | 5c 20 43 75 72 52 65 73 |file....|\ CurRes|
|000016e0| 46 69 6c 65 0d 31 0d 46 | 55 4e 43 54 49 4f 4e 20 |File.1.F|UNCTION |
|000016f0| 43 75 72 52 65 73 46 69 | 6c 65 20 20 3a 20 49 4e |CurResFi|le : IN|
|00001700| 54 45 47 45 52 3b 0d 0d | 43 75 72 52 65 73 46 69 |TEGER;..|CurResFi|
|00001710| 6c 65 20 72 65 74 75 72 | 6e 73 20 74 68 65 20 72 |le retur|ns the r|
|00001720| 65 66 65 72 65 6e 63 65 | 20 6e 75 6d 62 65 72 20 |eference| number |
|00001730| 6f 66 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 72 |of the c|urrent r|
|00001740| 65 73 6f 75 72 63 65 20 | 66 69 6c 65 2e 20 20 20 |esource |file. |
|00001750| 0d 59 6f 75 20 63 61 6e | 20 63 61 6c 6c 20 69 74 |.You can| call it|
|00001760| 20 77 68 65 6e 20 74 68 | 65 20 61 70 70 6c 69 63 | when th|e applic|
|00001770| 61 74 69 6f 6e 20 73 74 | 61 72 74 73 20 75 70 20 |ation st|arts up |
|00001780| 74 6f 20 67 65 74 20 74 | 68 65 20 72 65 66 65 72 |to get t|he refer|
|00001790| 65 6e 63 65 0d 6e 75 6d | 62 65 72 20 6f 66 20 69 |ence.num|ber of i|
|000017a0| 74 73 20 72 65 73 6f 75 | 72 63 65 20 66 69 6c 65 |ts resou|rce file|
|000017b0| 2e 20 0d 0d 28 6e 6f 74 | 65 29 0d 09 49 66 20 74 |. ..(not|e)..If t|
|000017c0| 68 65 20 73 79 73 74 65 | 6d 20 72 65 73 6f 75 72 |he syste|m resour|
|000017d0| 63 65 20 66 69 6c 65 20 | 69 73 20 74 68 65 20 63 |ce file |is the c|
|000017e0| 75 72 72 65 6e 74 20 72 | 65 73 6f 75 72 63 65 20 |urrent r|esource |
|000017f0| 66 69 6c 65 2c 20 0d 09 | 43 75 72 52 65 73 46 69 |file, ..|CurResFi|
|00001800| 6c 65 20 72 65 74 75 72 | 6e 73 20 74 68 65 20 61 |le retur|ns the a|
|00001810| 63 74 75 61 6c 20 72 65 | 66 65 72 65 6e 63 65 20 |ctual re|ference |
|00001820| 6e 75 6d 62 65 72 20 6f | 66 20 74 68 65 0d 09 73 |number o|f the..s|
|00001830| 79 73 74 65 6d 20 72 65 | 66 65 72 65 6e 63 65 20 |ystem re|ference |
|00001840| 66 69 6c 65 20 28 66 6f | 75 6e 64 20 69 6e 20 74 |file (fo|und in t|
|00001850| 68 65 20 67 6c 6f 62 61 | 6c 20 76 61 72 69 61 62 |he globa|l variab|
|00001860| 6c 65 20 0d 09 53 79 73 | 4d 61 70 29 2e 20 20 59 |le ..Sys|Map). Y|
|00001870| 6f 75 20 6e 65 65 64 6e | 27 74 20 77 6f 72 72 79 |ou needn|'t worry|
|00001880| 20 61 62 6f 75 74 20 74 | 68 69 73 20 6e 75 6d 62 | about t|his numb|
|00001890| 65 72 20 62 65 69 6e 67 | 20 75 73 65 64 20 0d 09 |er being| used ..|
|000018a0| 28 69 6e 73 74 65 61 64 | 20 6f 66 20 af 20 69 6e |(instead| of . in|
|000018b0| 20 74 68 65 20 72 6f 75 | 74 69 6e 65 73 20 74 68 | the rou|tines th|
|000018c0| 61 74 20 72 65 71 75 69 | 72 65 20 61 20 72 65 66 |at requi|re a ref|
|000018d0| 65 72 65 6e 63 65 0d 09 | 6e 75 6d 62 65 72 3b 20 |erence..|number; |
|000018e0| 74 68 65 73 65 20 72 6f | 75 74 69 6e 65 73 20 72 |these ro|utines r|
|000018f0| 65 63 6f 67 6e 69 7a 65 | 20 62 6f 74 68 20 af 20 |ecognize| both . |
|00001900| 61 6e 64 20 74 68 65 20 | 61 63 74 75 61 6c 0d 09 |and the |actual..|
|00001910| 72 65 66 65 72 65 6e 63 | 65 20 6e 75 6d 62 65 72 |referenc|e number|
|00001920| 20 61 73 20 72 65 66 65 | 72 72 69 6e 67 20 74 6f | as refe|rring to|
|00001930| 20 74 68 65 20 73 79 73 | 74 65 6d 20 72 65 73 6f | the sys|tem reso|
|00001940| 75 72 63 65 0d 09 66 69 | 6c 65 2e 0d 09 0d 5c 20 |urce..fi|le....\ |
|00001950| 48 6f 6d 65 52 65 73 46 | 69 6c 65 0d 31 0d 46 55 |HomeResF|ile.1.FU|
|00001960| 4e 43 54 49 4f 4e 20 48 | 6f 6d 65 52 65 73 46 69 |NCTION H|omeResFi|
|00001970| 6c 65 20 20 28 74 68 65 | 52 65 73 6f 75 72 63 65 |le (the|Resource|
|00001980| 3a 20 48 61 6e 64 6c 65 | 29 20 20 3a 20 20 49 4e |: Handle|) : IN|
|00001990| 54 45 47 45 52 0d 0d 47 | 69 76 65 6e 20 61 20 68 |TEGER..G|iven a h|
|000019a0| 61 6e 64 6c 65 20 74 6f | 20 61 20 72 65 73 6f 75 |andle to| a resou|
|000019b0| 72 63 65 2c 20 48 6f 6d | 65 52 65 73 46 69 6c 65 |rce, Hom|eResFile|
|000019c0| 20 72 65 74 75 72 6e 73 | 20 74 68 65 20 72 65 66 | returns| the ref|
|000019d0| 65 72 65 6e 63 65 20 6e | 75 6d 62 65 72 0d 6f 66 |erence n|umber.of|
|000019e0| 20 74 68 65 20 72 65 73 | 6f 75 72 63 65 20 66 69 | the res|ource fi|
|000019f0| 6c 65 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 74 68 |le conta|ining th|
|00001a00| 61 74 20 72 65 73 6f 75 | 72 63 65 2e 20 20 49 66 |at resou|rce. If|
|00001a10| 20 74 68 65 20 67 69 76 | 65 6e 20 68 61 6e 64 6c | the giv|en handl|
|00001a20| 65 0d 69 73 6e 27 74 20 | 61 20 68 61 6e 64 6c 65 |e.isn't |a handle|
|00001a30| 20 74 6f 20 61 20 72 65 | 73 6f 75 72 63 65 2c 20 | to a re|source, |
|00001a40| 48 6f 6d 65 52 65 73 46 | 69 6c 65 20 77 69 6c 6c |HomeResF|ile will|
|00001a50| 20 72 65 74 75 72 6e 20 | 2d 31 20 61 6e 64 20 74 | return |-1 and t|
|00001a60| 68 65 20 0d 52 65 73 45 | 72 72 6f 72 20 66 75 6e |he .ResE|rror fun|
|00001a70| 63 74 69 6f 6e 20 77 69 | 6c 6c 20 72 65 74 75 72 |ction wi|ll retur|
|00001a80| 6e 20 74 68 65 20 72 65 | 73 75 6c 74 20 63 6f 64 |n the re|sult cod|
|00001a90| 65 20 72 65 73 4e 6f 74 | 46 6f 75 6e 64 2e 0d 0d |e resNot|Found...|
|00001aa0| 0d 5c 20 55 73 65 52 65 | 73 46 69 6c 65 0d 31 0d |.\ UseRe|sFile.1.|
|00001ab0| 50 52 4f 43 45 44 55 52 | 45 20 55 73 65 52 65 73 |PROCEDUR|E UseRes|
|00001ac0| 46 69 6c 65 20 20 28 72 | 65 66 4e 75 6d 3a 20 20 |File (r|efNum: |
|00001ad0| 49 4e 54 45 47 45 52 29 | 3b 0d 0d 47 69 76 65 6e |INTEGER)|;..Given|
|00001ae0| 20 74 68 65 20 72 65 66 | 65 72 65 6e 63 65 20 6e | the ref|erence n|
|00001af0| 75 6d 62 65 72 20 6f 66 | 20 61 20 72 65 73 6f 75 |umber of| a resou|
|00001b00| 72 63 65 20 66 69 6c 65 | 2c 20 55 73 65 52 65 73 |rce file|, UseRes|
|00001b10| 46 69 6c 65 20 73 65 74 | 73 20 74 68 65 20 20 0d |File set|s the .|
|00001b20| 63 75 72 72 65 6e 74 20 | 72 65 73 6f 75 72 63 65 |current |resource|
|00001b30| 20 66 69 6c 65 20 74 6f | 20 74 68 61 74 20 66 69 | file to| that fi|
|00001b40| 6c 65 2e 20 20 49 66 20 | 74 68 65 72 65 27 73 20 |le. If |there's |
|00001b50| 6e 6f 20 72 65 73 6f 75 | 72 63 65 20 66 69 6c 65 |no resou|rce file|
|00001b60| 20 6f 70 65 6e 0d 77 69 | 74 68 20 74 68 65 20 67 | open.wi|th the g|
|00001b70| 69 76 65 6e 20 72 65 66 | 65 72 65 6e 63 65 20 6e |iven ref|erence n|
|00001b80| 75 6d 62 65 72 2c 20 55 | 73 65 52 65 73 46 69 6c |umber, U|seResFil|
|00001b90| 65 20 77 69 6c 6c 20 64 | 6f 20 6e 6f 74 68 69 6e |e will d|o nothin|
|00001ba0| 67 20 61 6e 64 20 74 68 | 65 20 0d 52 65 73 45 72 |g and th|e .ResEr|
|00001bb0| 72 6f 72 20 66 75 6e 63 | 74 69 6f 6e 20 77 69 6c |ror func|tion wil|
|00001bc0| 6c 20 72 65 74 75 72 6e | 20 74 68 65 20 72 65 73 |l return| the res|
|00001bd0| 75 6c 74 20 63 6f 64 65 | 20 72 65 73 46 4e 6f 74 |ult code| resFNot|
|00001be0| 46 6f 75 6e 64 2e 20 20 | 41 20 72 65 66 4e 75 6d |Found. |A refNum|
|00001bf0| 0d 6f 66 20 af 20 72 65 | 70 72 65 73 65 6e 74 73 |.of . re|presents|
|00001c00| 20 74 68 65 20 73 79 73 | 74 65 6d 20 72 65 73 6f | the sys|tem reso|
|00001c10| 75 72 63 65 20 66 69 6c | 65 2e 20 0d 0d 4f 70 65 |urce fil|e. ..Ope|
|00001c20| 6e 20 72 65 73 6f 75 72 | 63 65 20 66 69 6c 65 73 |n resour|ce files|
|00001c30| 20 61 72 65 20 61 72 72 | 61 6e 67 65 64 20 61 73 | are arr|anged as|
|00001c40| 20 61 20 6c 69 6e 6b 65 | 64 20 6c 69 73 74 3b 20 | a linke|d list; |
|00001c50| 74 68 65 20 6d 6f 73 74 | 20 72 65 63 65 6e 74 6c |the most| recentl|
|00001c60| 79 20 0d 6f 70 65 6e 65 | 64 20 66 69 6c 65 20 69 |y .opene|d file i|
|00001c70| 73 20 61 74 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |s at the| end of |
|00001c80| 74 68 65 20 6c 69 73 74 | 20 61 6e 64 20 69 73 20 |the list| and is |
|00001c90| 74 68 65 20 66 69 72 73 | 74 20 6f 6e 65 20 74 6f |the firs|t one to|
|00001ca0| 20 62 65 0d 73 65 61 72 | 63 68 65 64 2e 20 20 55 | be.sear|ched. U|
|00001cb0| 73 65 52 65 73 46 69 6c | 65 20 6c 65 74 73 20 79 |seResFil|e lets y|
|00001cc0| 6f 75 20 73 74 61 72 74 | 20 74 68 65 20 73 65 61 |ou start| the sea|
|00001cd0| 72 63 68 20 77 69 74 68 | 20 61 20 66 69 6c 65 20 |rch with| a file |
|00001ce0| 6f 70 65 6e 65 64 0d 65 | 61 72 6c 69 65 72 3b 20 |opened.e|arlier; |
|00001cf0| 74 68 65 20 66 69 6c 65 | 28 73 29 20 66 6f 6c 6c |the file|(s) foll|
|00001d00| 6f 77 69 6e 67 20 69 74 | 20 6f 6e 20 74 68 65 20 |owing it| on the |
|00001d10| 6c 69 73 74 20 61 74 65 | 20 74 68 65 6e 20 6c 65 |list ate| then le|
|00001d20| 66 74 20 6f 75 74 20 6f | 66 20 74 68 65 20 0d 73 |ft out o|f the .s|
|00001d30| 65 61 72 63 68 20 70 72 | 6f 63 65 73 73 2e 20 20 |earch pr|ocess. |
|00001d40| 54 68 69 73 20 69 73 20 | 62 65 73 74 20 75 6e 64 |This is |best und|
|00001d50| 65 72 73 74 6f 6f 64 20 | 77 69 74 68 20 61 6e 20 |erstood |with an |
|00001d60| 65 78 61 6d 70 6c 65 2e | 20 20 41 73 73 75 6d 65 |example.| Assume|
|00001d70| 20 74 68 65 72 65 20 0d | 61 72 65 20 66 6f 75 72 | there .|are four|
|00001d80| 20 6f 70 65 6e 20 72 65 | 73 6f 75 72 63 65 20 66 | open re|source f|
|00001d90| 69 6c 65 73 20 28 52 af | 20 74 68 72 6f 75 67 68 |iles (R.| through|
|00001da0| 20 52 33 29 3b 20 74 68 | 65 20 73 65 61 72 63 68 | R3); th|e search|
|00001db0| 20 6f 72 64 65 72 20 69 | 73 20 52 33 2c 0d 52 32 | order i|s R3,.R2|
|00001dc0| 2c 20 52 31 2c 20 52 af | 2e 20 20 49 66 20 79 6f |, R1, R.|. If yo|
|00001dd0| 75 20 63 61 6c 6c 20 55 | 73 65 52 65 73 46 69 6c |u call U|seResFil|
|00001de0| 65 28 52 32 29 2c 20 74 | 68 65 20 73 65 61 72 63 |e(R2), t|he searc|
|00001df0| 68 20 6f 72 64 65 72 20 | 62 65 63 6f 6d 65 73 20 |h order |becomes |
|00001e00| 52 32 2c 20 0d 52 31 2c | 20 52 af 3b 20 52 33 20 |R2, .R1,| R.; R3 |
|00001e10| 69 73 20 6e 6f 20 6c 6f | 6e 67 65 72 20 73 65 61 |is no lo|nger sea|
|00001e20| 72 63 68 65 64 2e 20 20 | 49 66 20 79 6f 75 20 74 |rched. |If you t|
|00001e30| 68 65 6e 20 6f 70 65 6e | 20 61 20 66 69 66 74 68 |hen open| a fifth|
|00001e40| 20 72 65 73 6f 75 72 63 | 65 0d 66 69 6c 65 20 28 | resourc|e.file (|
|00001e50| 52 34 29 2c 20 69 74 27 | 73 20 61 64 64 65 64 20 |R4), it'|s added |
|00001e60| 74 6f 20 74 68 65 20 65 | 6e 64 20 6f 66 20 74 68 |to the e|nd of th|
|00001e70| 65 20 6c 69 73 74 20 61 | 6e 64 20 74 68 65 20 73 |e list a|nd the s|
|00001e80| 65 61 72 63 68 20 6f 72 | 64 65 72 0d 62 65 63 6f |earch or|der.beco|
|00001e90| 6d 65 73 20 52 34 2c 20 | 52 33 2c 20 52 32 2c 20 |mes R4, |R3, R2, |
|00001ea0| 52 31 2c 20 52 af 2e 0d | 0d 54 68 69 73 20 70 72 |R1, R...|.This pr|
|00001eb0| 6f 63 65 64 75 72 65 20 | 69 73 20 75 73 65 66 75 |ocedure |is usefu|
|00001ec0| 6c 20 69 66 20 79 6f 75 | 20 6e 6f 20 6c 6f 6e 67 |l if you| no long|
|00001ed0| 65 72 20 77 61 6e 74 20 | 74 6f 20 6f 76 65 72 72 |er want |to overr|
|00001ee0| 69 64 65 20 61 20 73 79 | 73 74 65 6d 0d 72 65 73 |ide a sy|stem.res|
|00001ef0| 6f 75 72 63 65 20 77 69 | 74 68 20 6f 6e 65 20 62 |ource wi|th one b|
|00001f00| 79 20 74 68 65 20 73 61 | 6d 65 20 6e 61 6d 65 20 |y the sa|me name |
|00001f10| 69 6e 20 79 6f 75 72 20 | 61 70 70 6c 69 63 61 74 |in your |applicat|
|00001f20| 69 6f 6e 27 73 20 72 65 | 73 6f 75 72 63 65 20 66 |ion's re|source f|
|00001f30| 69 6c 65 2e 20 0d 59 6f | 75 20 63 61 6e 20 63 61 |ile. .Yo|u can ca|
|00001f40| 6c 6c 20 55 73 65 52 65 | 73 46 69 6c 65 28 af 29 |ll UseRe|sFile(.)|
|00001f50| 20 74 6f 20 6c 65 61 76 | 65 20 74 68 65 20 61 70 | to leav|e the ap|
|00001f60| 70 6c 69 63 61 74 69 6f | 6e 20 72 65 73 6f 75 72 |plicatio|n resour|
|00001f70| 63 65 20 66 69 6c 65 20 | 6f 75 74 0d 6f 66 20 74 |ce file |out.of t|
|00001f80| 68 65 20 73 65 61 72 63 | 68 2c 20 63 61 75 73 69 |he searc|h, causi|
|00001f90| 6e 67 20 6f 6e 6c 79 20 | 74 68 65 20 73 79 73 74 |ng only |the syst|
|00001fa0| 65 6d 20 72 65 73 6f 75 | 72 63 65 20 66 69 6c 65 |em resou|rce file|
|00001fb0| 20 74 6f 20 62 65 20 73 | 65 61 72 63 68 65 64 2e | to be s|earched.|
|00001fc0| 20 0d 0d 28 77 61 72 6e | 69 6e 67 29 0d 09 45 61 | ..(warn|ing)..Ea|
|00001fd0| 72 6c 79 20 76 65 72 73 | 69 6f 6e 73 20 6f 66 20 |rly vers|ions of |
|00001fe0| 73 6f 6d 65 20 64 65 73 | 6b 20 61 63 63 65 73 73 |some des|k access|
|00001ff0| 6f 72 69 65 73 20 6d 61 | 79 2c 20 75 70 6f 6e 20 |ories ma|y, upon |
|00002000| 0d 09 63 6c 6f 73 69 6e | 67 2c 20 61 6c 77 61 79 |..closin|g, alway|
|00002010| 73 20 73 65 74 20 74 68 | 65 20 63 75 72 72 65 6e |s set th|e curren|
|00002020| 74 20 72 65 73 6f 75 72 | 63 65 20 66 69 6c 65 20 |t resour|ce file |
|00002030| 74 6f 20 74 68 65 20 6f | 6e 65 0d 09 6f 70 65 6e |to the o|ne..open|
|00002040| 65 64 20 6a 75 73 74 20 | 70 72 69 6f 72 20 74 6f |ed just |prior to|
|00002050| 20 74 68 65 20 61 63 63 | 65 73 73 6f 72 79 2c 20 | the acc|essory, |
|00002060| 69 67 6e 6f 72 69 6e 67 | 20 61 6e 79 20 0d 09 61 |ignoring| any ..a|
|00002070| 64 64 69 74 69 6f 6e 61 | 6c 20 72 65 73 6f 75 72 |dditiona|l resour|
|00002080| 63 65 20 66 69 6c 65 73 | 20 74 68 61 74 20 6d 61 |ce files| that ma|
|00002090| 79 20 68 61 76 65 20 62 | 65 65 6e 20 6f 70 65 6e |y have b|een open|
|000020a0| 65 64 20 77 68 69 6c 65 | 20 0d 09 74 68 65 20 61 |ed while| ..the a|
|000020b0| 63 63 65 73 73 6f 72 79 | 20 77 61 73 20 69 6e 20 |ccessory| was in |
|000020c0| 75 73 65 2e 20 20 54 6f | 20 62 65 20 73 61 66 65 |use. To| be safe|
|000020d0| 2c 20 77 68 65 6e 65 76 | 65 72 20 64 65 73 6b 0d |, whenev|er desk.|
|000020e0| 09 61 63 63 65 73 73 6f | 72 69 65 73 20 6d 61 79 |.accesso|ries may|
|000020f0| 20 68 61 76 65 20 62 65 | 65 6e 20 69 6e 20 75 73 | have be|en in us|
|00002100| 65 2c 20 63 61 6c 6c 20 | 55 73 65 52 65 73 46 69 |e, call |UseResFi|
|00002110| 6c 65 20 74 6f 0d 09 65 | 6e 73 75 72 65 20 61 63 |le to..e|nsure ac|
|00002120| 63 65 73 73 20 74 6f 20 | 72 65 73 6f 75 72 63 65 |cess to |resource|
|00002130| 20 66 69 6c 65 73 20 6f | 70 65 6e 65 64 20 61 66 | files o|pened af|
|00002140| 74 65 72 20 61 63 63 65 | 73 73 6f 72 69 65 73 2e |ter acce|ssories.|
|00002150| 0d 09 0d 0d 5c 20 43 6f | 75 6e 74 54 79 70 65 73 |....\ Co|untTypes|
|00002160| 0d 31 0d 46 55 4e 43 54 | 49 4f 4e 20 43 6f 75 6e |.1.FUNCT|ION Coun|
|00002170| 74 54 79 70 65 73 20 3a | 20 49 4e 54 45 47 45 52 |tTypes :| INTEGER|
|00002180| 3b 0d 0d 43 6f 75 6e 74 | 54 79 70 65 73 20 72 65 |;..Count|Types re|
|00002190| 74 75 72 6e 73 20 74 68 | 65 20 6e 75 6d 62 65 72 |turns th|e number|
|000021a0| 20 6f 66 20 72 65 73 6f | 75 72 63 65 20 74 79 70 | of reso|urce typ|
|000021b0| 65 73 20 69 6e 20 61 6c | 6c 20 6f 70 65 6e 20 72 |es in al|l open r|
|000021c0| 65 73 6f 75 72 63 65 0d | 66 69 6c 65 73 2e 0d 0d |esource.|files...|
|000021d0| 0d 5c 20 47 65 74 49 6e | 64 54 79 70 65 20 0d 31 |.\ GetIn|dType .1|
|000021e0| 0d 50 52 4f 43 45 44 55 | 52 45 20 47 65 74 49 6e |.PROCEDU|RE GetIn|
|000021f0| 64 54 79 70 65 20 28 56 | 41 52 20 74 68 65 54 79 |dType (V|AR theTy|
|00002200| 70 65 3a 20 52 65 73 54 | 79 70 65 3b 20 69 6e 64 |pe: ResT|ype; ind|
|00002210| 65 78 3a 20 49 4e 54 45 | 47 45 52 29 3b 0d 0d 47 |ex: INTE|GER);..G|
|00002220| 69 76 65 6e 20 61 6e 20 | 69 6e 64 65 78 20 72 61 |iven an |index ra|
|00002230| 6e 67 69 6e 67 20 66 72 | 6f 6d 20 31 20 74 6f 20 |nging fr|om 1 to |
|00002240| 43 6f 75 6e 74 54 79 70 | 65 73 20 28 61 62 6f 76 |CountTyp|es (abov|
|00002250| 65 2c 20 47 65 74 49 6e | 64 54 79 70 65 20 72 65 |e, GetIn|dType re|
|00002260| 74 75 72 6e 73 0d 61 20 | 72 65 73 6f 75 72 63 65 |turns.a |resource|
|00002270| 20 74 79 70 65 20 69 6e | 20 74 68 65 54 79 70 65 | type in| theType|
|00002280| 2e 20 20 43 61 6c 6c 65 | 64 20 72 65 70 65 61 74 |. Calle|d repeat|
|00002290| 65 64 6c 79 20 6f 76 65 | 72 20 74 68 65 20 65 6e |edly ove|r the en|
|000022a0| 74 69 72 65 20 72 61 6e | 67 65 20 0d 66 6f 72 20 |tire ran|ge .for |
|000022b0| 74 68 65 20 69 6e 64 65 | 78 2c 20 69 74 20 72 65 |the inde|x, it re|
|000022c0| 74 75 72 6e 73 20 61 6c | 6c 20 74 68 65 20 72 65 |turns al|l the re|
|000022d0| 73 6f 75 72 63 65 20 74 | 79 70 65 73 20 69 6e 20 |source t|ypes in |
|000022e0| 61 6c 6c 20 6f 70 65 6e | 20 72 65 73 6f 75 72 63 |all open| resourc|
|000022f0| 65 0d 66 69 6c 65 73 2e | 20 20 49 66 20 74 68 65 |e.files.| If the|
|00002300| 20 67 69 76 65 6e 20 69 | 6e 64 65 78 20 69 73 6e | given i|ndex isn|
|00002310| 27 74 20 69 6e 20 74 68 | 65 20 72 61 6e 67 65 20 |'t in th|e range |
|00002320| 66 72 6f 6d 20 31 20 74 | 6f 20 43 6f 75 6e 74 54 |from 1 t|o CountT|
|00002330| 79 70 65 73 2c 20 0d 47 | 65 74 49 6e 64 54 79 70 |ypes, .G|etIndTyp|
|00002340| 65 20 72 65 74 75 72 6e | 73 20 66 6f 75 72 20 4e |e return|s four N|
|00002350| 55 4c 20 63 68 61 72 61 | 63 74 65 72 73 20 28 41 |UL chara|cters (A|
|00002360| 53 43 49 49 20 63 6f 64 | 65 20 af 29 2e 0d 0d 0d |SCII cod|e .)....|
|00002370| 5c 20 53 65 74 52 65 73 | 4c 6f 61 64 0d 31 0d 50 |\ SetRes|Load.1.P|
|00002380| 52 4f 43 45 44 55 52 45 | 20 53 65 74 52 65 73 4c |ROCEDURE| SetResL|
|00002390| 6f 61 64 20 28 6c 6f 61 | 64 3a 20 42 4f 4f 4c 45 |oad (loa|d: BOOLE|
|000023a0| 41 4e 29 3b 0d 0d 4e 6f | 72 6d 61 6c 6c 79 2c 20 |AN);..No|rmally, |
|000023b0| 74 68 65 20 72 6f 75 74 | 69 6e 65 73 20 74 68 61 |the rout|ines tha|
|000023c0| 74 20 72 65 74 75 72 6e | 20 68 61 6e 64 6c 65 73 |t return| handles|
|000023d0| 20 74 6f 20 72 65 73 6f | 75 72 63 65 73 20 72 65 | to reso|urces re|
|000023e0| 61 64 20 74 68 65 20 0d | 72 65 73 6f 75 72 63 65 |ad the .|resource|
|000023f0| 20 64 61 74 61 20 69 6e | 74 6f 20 6d 65 6d 6f 72 | data in|to memor|
|00002400| 79 20 69 66 20 69 74 27 | 73 20 6e 6f 74 20 61 6c |y if it'|s not al|
|00002410| 72 65 61 64 79 20 69 6e | 20 6d 65 6d 6f 72 79 2e |ready in| memory.|
|00002420| 0d 53 65 74 52 65 73 4c | 6f 61 64 28 46 41 4c 53 |.SetResL|oad(FALS|
|00002430| 45 29 20 61 66 66 65 63 | 74 73 20 61 6c 6c 20 74 |E) affec|ts all t|
|00002440| 68 6f 73 65 20 72 6f 75 | 74 69 6e 65 73 20 73 6f |hose rou|tines so|
|00002450| 20 74 68 61 74 20 74 68 | 65 79 20 77 69 6c 6c 20 | that th|ey will |
|00002460| 6e 6f 74 20 72 65 61 64 | 0d 74 68 65 20 72 65 73 |not read|.the res|
|00002470| 6f 75 72 63 65 20 64 61 | 74 61 20 69 6e 74 6f 20 |ource da|ta into |
|00002480| 6d 65 6d 6f 72 79 20 61 | 6e 64 20 77 69 6c 6c 20 |memory a|nd will |
|00002490| 72 65 74 75 72 6e 20 61 | 6e 20 65 6d 70 74 79 20 |return a|n empty |
|000024a0| 68 61 6e 64 6c 65 2e 0d | 52 65 73 6f 75 72 63 65 |handle..|Resource|
|000024b0| 73 20 77 68 6f 73 65 20 | 72 65 73 50 72 65 6c 6f |s whose |resPrelo|
|000024c0| 61 64 20 61 74 74 72 72 | 69 62 75 74 65 20 69 73 |ad attrr|ibute is|
|000024d0| 20 73 65 74 20 77 69 6c | 6c 20 73 74 69 6c 6c 20 | set wil|l still |
|000024e0| 62 65 20 72 65 61 64 20 | 69 6e 2c 20 0d 68 6f 77 |be read |in, .how|
|000024f0| 65 76 65 72 2c 20 77 68 | 65 6e 20 61 20 72 65 73 |ever, wh|en a res|
|00002500| 6f 75 72 63 65 20 66 69 | 6c 65 20 69 73 20 6f 70 |ource fi|le is op|
|00002510| 65 6e 65 64 2e 20 20 53 | 65 74 52 65 73 4c 6f 61 |ened. S|etResLoa|
|00002520| 64 28 54 52 55 45 29 20 | 72 65 73 74 6f 72 65 73 |d(TRUE) |restores|
|00002530| 20 74 68 65 20 0d 6e 6f | 72 6d 61 6c 20 73 74 61 | the .no|rmal sta|
|00002540| 74 65 2e 0d 0d 28 77 61 | 72 6e 69 6e 67 29 0d 09 |te...(wa|rning)..|
|00002550| 49 66 20 79 6f 75 20 63 | 61 6c 6c 20 53 65 74 52 |If you c|all SetR|
|00002560| 65 73 4c 6f 61 64 28 46 | 41 4c 53 45 29 2c 20 62 |esLoad(F|ALSE), b|
|00002570| 65 20 73 75 72 65 20 74 | 6f 20 72 65 73 74 6f 72 |e sure t|o restor|
|00002580| 65 20 74 68 65 20 0d 09 | 6e 6f 72 6d 61 6c 20 73 |e the ..|normal s|
|00002590| 74 61 74 65 20 61 73 20 | 73 6f 6f 6e 20 61 73 20 |tate as |soon as |
|000025a0| 70 6f 73 73 69 62 6c 65 | 2c 20 62 65 63 61 75 73 |possible|, becaus|
|000025b0| 65 20 6f 74 68 65 72 20 | 70 61 72 74 73 20 6f 66 |e other |parts of|
|000025c0| 20 0d 09 74 68 65 20 54 | 6f 6f 6c 62 6f 78 20 74 | ..the T|oolbox t|
|000025d0| 68 61 74 20 63 61 6c 6c | 20 74 68 65 20 52 65 73 |hat call| the Res|
|000025e0| 6f 75 72 63 65 20 4d 61 | 6e 61 67 65 72 20 72 65 |ource Ma|nager re|
|000025f0| 6c 79 20 6f 6e 20 69 74 | 2e 20 0d 09 0d 09 0d 5c |ly on it|. .....\|
|00002600| 20 43 6f 75 6e 74 52 65 | 73 6f 75 72 63 65 73 0d | CountRe|sources.|
|00002610| 31 0d 46 55 4e 43 54 49 | 4f 4e 20 43 6f 75 6e 74 |1.FUNCTI|ON Count|
|00002620| 52 65 73 6f 75 72 63 65 | 73 20 28 74 68 65 54 79 |Resource|s (theTy|
|00002630| 70 65 3a 20 52 65 73 54 | 79 70 65 29 20 3a 20 49 |pe: ResT|ype) : I|
|00002640| 4e 54 45 47 45 52 3b 0d | 0d 43 6f 75 6e 74 52 65 |NTEGER;.|.CountRe|
|00002650| 73 6f 75 72 63 65 73 20 | 72 65 74 75 72 6e 73 20 |sources |returns |
|00002660| 74 68 65 20 74 6f 74 61 | 6c 20 6e 75 6d 62 65 72 |the tota|l number|
|00002670| 20 6f 66 20 72 65 73 6f | 75 72 63 65 73 20 6f 66 | of reso|urces of|
|00002680| 20 74 68 65 20 67 69 76 | 65 6e 20 74 79 70 65 0d | the giv|en type.|
|00002690| 69 6e 20 61 6c 6c 20 6f | 70 65 6e 20 72 65 73 6f |in all o|pen reso|
|000026a0| 75 72 63 65 20 66 69 6c | 65 73 2e 0d 0d 0d 5c 20 |urce fil|es....\ |
|000026b0| 47 65 74 49 6e 64 52 65 | 73 6f 75 72 63 65 0d 31 |GetIndRe|source.1|
|000026c0| 0d 46 55 4e 43 54 49 4f | 4e 20 47 65 74 49 6e 64 |.FUNCTIO|N GetInd|
|000026d0| 52 65 73 6f 75 72 63 65 | 20 28 74 68 65 54 79 70 |Resource| (theTyp|
|000026e0| 65 3a 20 52 65 73 54 79 | 70 65 3b 20 69 6e 64 65 |e: ResTy|pe; inde|
|000026f0| 78 3a 20 49 4e 54 45 47 | 45 52 29 20 3a 20 48 61 |x: INTEG|ER) : Ha|
|00002700| 6e 64 6c 65 3b 0d 0d 47 | 69 76 65 6e 20 61 6e 20 |ndle;..G|iven an |
|00002710| 69 6e 64 65 78 20 72 61 | 6e 67 69 6e 67 20 66 72 |index ra|nging fr|
|00002720| 6f 6d 20 31 20 74 6f 20 | 43 6f 75 6e 74 52 65 73 |om 1 to |CountRes|
|00002730| 6f 75 72 63 65 73 28 74 | 68 65 54 79 70 65 29 2c |ources(t|heType),|
|00002740| 20 0d 47 65 74 49 6e 64 | 52 65 73 6f 75 72 63 65 | .GetInd|Resource|
|00002750| 20 72 65 74 75 72 6e 73 | 20 61 20 68 61 6e 64 6c | returns| a handl|
|00002760| 65 20 74 6f 20 61 20 72 | 65 73 6f 75 72 63 65 20 |e to a r|esource |
|00002770| 6f 66 20 74 68 65 20 67 | 69 76 65 6e 20 74 79 70 |of the g|iven typ|
|00002780| 65 20 28 73 65 65 0d 43 | 6f 75 6e 74 52 65 73 6f |e (see.C|ountReso|
|00002790| 75 72 63 65 73 2c 20 61 | 62 6f 76 65 29 2e 20 20 |urces, a|bove). |
|000027a0| 43 61 6c 6c 65 64 20 72 | 65 70 65 61 74 65 64 6c |Called r|epeatedl|
|000027b0| 79 20 6f 76 65 72 20 74 | 68 65 20 65 6e 74 69 72 |y over t|he entir|
|000027c0| 65 20 72 61 6e 67 65 20 | 66 6f 72 20 0d 74 68 65 |e range |for .the|
|000027d0| 20 69 6e 64 65 78 2c 20 | 69 74 20 72 65 74 75 72 | index, |it retur|
|000027e0| 6e 73 20 68 61 6e 64 6c | 65 73 20 74 6f 20 61 6c |ns handl|es to al|
|000027f0| 6c 20 72 65 73 6f 75 72 | 63 65 73 20 6f 66 20 74 |l resour|ces of t|
|00002800| 68 65 20 67 69 76 65 6e | 20 74 79 70 65 20 69 6e |he given| type in|
|00002810| 20 61 6c 6c 0d 6f 70 65 | 6e 20 72 65 73 6f 75 72 | all.ope|n resour|
|00002820| 63 65 20 66 69 6c 65 73 | 2e 20 20 47 65 74 49 6e |ce files|. GetIn|
|00002830| 64 52 65 73 6f 75 72 63 | 65 20 72 65 61 64 73 20 |dResourc|e reads |
|00002840| 74 68 65 20 72 65 73 6f | 75 72 63 65 20 64 61 74 |the reso|urce dat|
|00002850| 61 20 69 6e 74 6f 0d 6d | 65 6d 6f 72 79 20 69 66 |a into.m|emory if|
|00002860| 20 69 74 27 73 20 6e 6f | 74 20 61 6c 72 65 61 64 | it's no|t alread|
|00002870| 79 20 69 6e 20 6d 65 6d | 6f 72 79 2c 20 75 6e 6c |y in mem|ory, unl|
|00002880| 65 73 73 20 79 6f 75 27 | 76 65 20 63 61 6c 6c 65 |ess you'|ve calle|
|00002890| 64 0d 53 65 74 52 65 73 | 4c 6f 61 64 28 46 41 4c |d.SetRes|Load(FAL|
|000028a0| 53 45 29 2e 0d 0d 28 77 | 61 72 6e 69 6e 67 29 0d |SE)...(w|arning).|
|000028b0| 09 54 68 65 20 68 61 6e | 64 6c 65 20 72 65 74 75 |.The han|dle retu|
|000028c0| 72 6e 65 64 20 77 69 6c | 6c 20 62 65 20 61 6e 20 |rned wil|l be an |
|000028d0| 65 6d 70 74 79 20 68 61 | 6e 64 6c 65 20 69 66 20 |empty ha|ndle if |
|000028e0| 79 6f 75 27 76 65 0d 09 | 63 61 6c 6c 65 64 20 53 |you've..|called S|
|000028f0| 65 74 52 65 73 4c 6f 61 | 64 28 46 41 4c 53 45 29 |etResLoa|d(FALSE)|
|00002900| 20 28 61 6e 64 20 74 68 | 65 20 64 61 74 61 20 69 | (and th|e data i|
|00002910| 73 6e 27 74 20 61 6c 72 | 65 61 64 79 20 69 6e 20 |sn't alr|eady in |
|00002920| 0d 09 6d 65 6d 6f 72 79 | 29 2e 20 20 54 68 65 20 |..memory|). The |
|00002930| 68 61 6e 64 6c 65 20 77 | 69 6c 6c 20 62 65 63 6f |handle w|ill beco|
|00002940| 6d 65 20 65 6d 70 74 79 | 20 69 66 20 74 68 65 20 |me empty| if the |
|00002950| 72 65 73 6f 75 72 63 65 | 20 0d 09 64 61 74 61 20 |resource| ..data |
|00002960| 66 6f 72 20 61 20 70 75 | 72 67 65 61 62 6c 65 20 |for a pu|rgeable |
|00002970| 72 65 73 6f 75 72 63 65 | 20 69 73 20 72 65 61 64 |resource| is read|
|00002980| 20 69 6e 20 62 75 74 20 | 6c 61 74 65 72 0d 09 70 | in but |later..p|
|00002990| 75 72 67 65 64 2e 20 20 | 28 59 6f 75 20 63 61 6e |urged. |(You can|
|000029a0| 20 74 65 73 74 20 66 6f | 72 20 61 6e 20 65 6d 70 | test fo|r an emp|
|000029b0| 74 79 20 68 61 6e 64 6c | 65 20 77 69 74 68 2c 20 |ty handl|e with, |
|000029c0| 66 6f 72 0d 09 65 78 61 | 6d 70 6c 65 2c 20 6d 79 |for..exa|mple, my|
|000029d0| 48 6e 64 6c 5e 3d 20 4e | 49 4c 2e 29 20 20 54 6f |Hndl^= N|IL.) To|
|000029e0| 20 72 65 61 64 20 69 6e | 20 74 68 65 20 64 61 74 | read in| the dat|
|000029f0| 61 20 61 6e 64 20 6d 61 | 6b 65 20 0d 09 74 68 65 |a and ma|ke ..the|
|00002a00| 20 68 61 6e 64 6c 65 20 | 6e 6f 20 6c 6f 6e 67 65 | handle |no longe|
|00002a10| 72 20 62 65 20 65 6d 70 | 74 79 2c 20 79 6f 75 20 |r be emp|ty, you |
|00002a20| 63 61 6e 20 63 61 6c 6c | 20 4c 6f 61 64 52 65 73 |can call| LoadRes|
|00002a30| 6f 75 72 63 65 2e 20 0d | 09 0d 47 65 74 49 6e 64 |ource. .|..GetInd|
|00002a40| 52 65 73 6f 75 72 63 65 | 20 72 65 74 75 72 6e 73 |Resource| returns|
|00002a50| 20 68 61 6e 64 6c 65 73 | 20 66 6f 72 20 61 6c 6c | handles| for all|
|00002a60| 20 72 65 73 6f 75 72 63 | 65 73 20 69 6e 20 74 68 | resourc|es in th|
|00002a70| 65 20 6d 6f 73 74 20 72 | 65 63 65 6e 74 6c 79 0d |e most r|ecently.|
|00002a80| 6f 70 65 6e 65 64 20 72 | 65 73 6f 75 72 63 65 20 |opened r|esource |
|00002a90| 66 69 6c 65 20 66 69 72 | 73 74 2c 20 61 6e 64 20 |file fir|st, and |
|00002aa0| 74 68 65 6e 20 66 6f 72 | 20 74 68 6f 73 65 20 69 |then for| those i|
|00002ab0| 6e 20 74 68 65 20 72 65 | 73 6f 75 72 63 65 20 66 |n the re|source f|
|00002ac0| 69 6c 65 73 20 0d 6f 70 | 65 6e 65 64 20 62 65 66 |iles .op|ened bef|
|00002ad0| 6f 72 65 20 69 74 2c 20 | 69 6e 20 74 68 65 20 72 |ore it, |in the r|
|00002ae0| 65 76 65 72 73 65 20 6f | 66 20 74 68 65 20 6f 72 |everse o|f the or|
|00002af0| 64 65 72 20 74 68 61 74 | 20 74 68 65 79 20 77 65 |der that| they we|
|00002b00| 72 65 20 6f 70 65 6e 65 | 64 2e 0d 49 66 20 79 6f |re opene|d..If yo|
|00002b10| 75 20 77 61 6e 74 20 74 | 6f 20 66 69 6e 64 20 6f |u want t|o find o|
|00002b20| 75 74 20 68 6f 77 20 6d | 61 6e 79 20 72 65 73 6f |ut how m|any reso|
|00002b30| 75 72 63 65 73 20 6f 66 | 20 61 20 67 69 76 65 6e |urces of| a given|
|00002b40| 20 74 79 70 65 20 61 72 | 65 20 69 6e 20 61 20 0d | type ar|e in a .|
|00002b50| 70 61 72 74 69 63 75 6c | 61 72 20 72 65 73 6f 75 |particul|ar resou|
|00002b60| 72 63 65 20 66 69 6c 65 | 2c 20 79 6f 75 20 63 61 |rce file|, you ca|
|00002b70| 6e 20 64 6f 20 73 6f 20 | 61 73 20 66 6f 6c 6c 6f |n do so |as follo|
|00002b80| 77 73 3a 20 20 43 61 6c | 6c 20 20 0d 47 65 74 49 |ws: Cal|l .GetI|
|00002b90| 6e 64 52 65 73 6f 75 72 | 63 65 20 72 65 70 65 61 |ndResour|ce repea|
|00002ba0| 74 65 64 6c 79 20 77 69 | 74 68 20 74 68 65 20 69 |tedly wi|th the i|
|00002bb0| 6e 64 65 78 20 72 61 6e | 67 69 6e 67 20 66 72 6f |ndex ran|ging fro|
|00002bc0| 6d 20 31 20 74 6f 20 74 | 68 65 20 6e 75 6d 62 65 |m 1 to t|he numbe|
|00002bd0| 72 0d 6f 66 20 72 65 73 | 6f 75 72 63 65 73 20 6f |r.of res|ources o|
|00002be0| 66 20 74 68 61 74 20 74 | 79 70 65 2e 20 20 50 61 |f that t|ype. Pa|
|00002bf0| 73 73 20 65 61 63 68 20 | 68 61 6e 64 6c 65 20 72 |ss each |handle r|
|00002c00| 65 74 75 72 6e 65 64 20 | 62 79 20 47 65 74 49 6e |eturned |by GetIn|
|00002c10| 64 52 65 73 6f 75 72 63 | 65 0d 74 6f 20 48 6f 6d |dResourc|e.to Hom|
|00002c20| 65 52 65 73 46 69 6c 65 | 20 61 6e 64 20 63 6f 75 |eResFile| and cou|
|00002c30| 6e 74 20 61 6c 6c 20 6f | 63 63 75 72 72 65 6e 63 |nt all o|ccurrenc|
|00002c40| 65 73 20 77 68 65 72 65 | 20 74 68 65 20 72 65 66 |es where| the ref|
|00002c50| 65 72 65 6e 63 65 20 6e | 75 6d 62 65 72 20 0d 72 |erence n|umber .r|
|00002c60| 65 74 75 72 6e 65 64 20 | 69 73 20 74 68 61 74 20 |eturned |is that |
|00002c70| 6f 66 20 74 68 65 20 64 | 65 73 69 72 65 64 20 66 |of the d|esired f|
|00002c80| 69 6c 65 2e 20 20 42 65 | 20 73 75 72 65 20 74 6f |ile. Be| sure to|
|00002c90| 20 73 74 61 72 74 20 74 | 68 65 20 69 6e 64 65 78 | start t|he index|
|00002ca0| 20 66 72 6f 6d 20 0d 31 | 2c 20 61 6e 64 20 74 6f | from .1|, and to|
|00002cb0| 20 63 61 6c 6c 20 53 65 | 74 52 65 73 4c 6f 61 64 | call Se|tResLoad|
|00002cc0| 28 46 41 4c 53 45 29 20 | 73 6f 20 74 68 65 20 72 |(FALSE) |so the r|
|00002cd0| 65 73 6f 75 72 63 65 73 | 20 77 6f 6e 27 74 20 62 |esources| won't b|
|00002ce0| 65 20 72 65 61 64 20 69 | 6e 2e 0d 0d 28 6e 6f 74 |e read i|n...(not|
|00002cf0| 65 29 0d 09 54 68 65 20 | 55 73 65 52 65 73 46 69 |e)..The |UseResFi|
|00002d00| 6c 65 20 70 72 6f 63 65 | 64 75 72 65 20 61 66 66 |le proce|dure aff|
|00002d10| 65 63 74 73 20 77 68 69 | 63 68 20 66 69 6c 65 20 |ects whi|ch file |
|00002d20| 74 68 65 20 52 65 73 6f | 75 72 63 65 0d 09 4d 61 |the Reso|urce..Ma|
|00002d30| 6e 61 67 65 72 20 73 65 | 61 72 63 68 65 73 20 66 |nager se|arches f|
|00002d40| 69 72 73 74 20 77 68 65 | 6e 20 6c 6f 6f 6b 69 6e |irst whe|n lookin|
|00002d50| 67 20 66 6f 72 20 61 20 | 70 61 72 74 69 63 75 6c |g for a |particul|
|00002d60| 61 72 20 0d 09 72 65 73 | 6f 75 72 63 65 20 62 75 |ar ..res|ource bu|
|00002d70| 74 20 6e 6f 74 20 77 68 | 65 6e 20 67 65 74 74 69 |t not wh|en getti|
|00002d80| 6e 67 20 69 6e 64 65 78 | 65 64 20 72 65 73 6f 75 |ng index|ed resou|
|00002d90| 72 63 65 73 20 20 77 69 | 74 68 0d 09 47 65 74 49 |rces wi|th..GetI|
|00002da0| 6e 64 52 65 73 6f 75 72 | 63 65 2e 0d 09 0d 49 66 |ndResour|ce....If|
|00002db0| 20 74 68 65 20 67 69 76 | 65 6e 20 69 6e 64 65 78 | the giv|en index|
|00002dc0| 20 69 73 6e 27 74 20 69 | 6e 20 74 68 65 20 72 61 | isn't i|n the ra|
|00002dd0| 6e 67 65 20 66 72 6f 6d | 20 31 20 74 6f 0d 43 6f |nge from| 1 to.Co|
|00002de0| 75 6e 74 52 65 73 6f 75 | 72 63 65 73 28 74 68 65 |untResou|rces(the|
|00002df0| 54 79 70 65 29 2c 20 47 | 65 74 49 6e 64 52 65 73 |Type), G|etIndRes|
|00002e00| 6f 75 72 63 65 20 72 65 | 74 75 72 6e 73 20 4e 49 |ource re|turns NI|
|00002e10| 4c 20 61 6e 64 20 74 68 | 65 20 52 65 73 45 72 72 |L and th|e ResErr|
|00002e20| 6f 72 0d 66 75 6e 63 74 | 69 6f 6e 20 77 69 6c 6c |or.funct|ion will|
|00002e30| 20 72 65 74 75 72 6e 20 | 74 68 65 20 72 65 73 75 | return |the resu|
|00002e40| 6c 74 20 63 6f 64 65 20 | 72 65 73 4e 6f 74 46 6f |lt code |resNotFo|
|00002e50| 75 6e 64 2e 20 20 47 65 | 74 49 6e 64 52 65 73 6f |und. Ge|tIndReso|
|00002e60| 75 72 63 65 20 61 6c 73 | 6f 0d 72 65 74 75 72 6e |urce als|o.return|
|00002e70| 73 20 4e 49 4c 20 69 66 | 20 74 68 65 20 72 65 73 |s NIL if| the res|
|00002e80| 6f 75 72 63 65 20 69 73 | 20 74 6f 20 62 65 20 72 |ource is| to be r|
|00002e90| 65 61 64 20 69 6e 74 6f | 20 6d 65 6d 6f 72 79 20 |ead into| memory |
|00002ea0| 62 75 74 20 77 6f 6e 27 | 74 20 66 69 74 3b 20 69 |but won'|t fit; i|
|00002eb0| 6e 0d 74 68 69 73 20 63 | 61 73 65 2c 20 52 65 73 |n.this c|ase, Res|
|00002ec0| 45 72 72 6f 72 20 77 69 | 6c 6c 20 72 65 74 75 72 |Error wi|ll retur|
|00002ed0| 6e 20 61 6e 20 61 70 70 | 72 6f 70 72 69 61 74 65 |n an app|ropriate|
|00002ee0| 20 4f 70 65 72 61 74 69 | 6e 67 20 53 79 73 74 65 | Operati|ng Syste|
|00002ef0| 6d 20 72 65 73 75 6c 74 | 0d 63 6f 64 65 2e 0d 0d |m result|.code...|
|00002f00| 0d 5c 20 47 65 74 52 65 | 73 6f 75 72 63 65 0d 31 |.\ GetRe|source.1|
|00002f10| 0d 46 55 4e 43 54 49 4f | 4e 20 47 65 74 20 52 65 |.FUNCTIO|N Get Re|
|00002f20| 73 6f 75 72 63 65 20 28 | 74 68 65 54 79 70 65 3a |source (|theType:|
|00002f30| 20 52 65 73 54 79 70 65 | 3b 20 74 68 65 20 49 44 | ResType|; the ID|
|00002f40| 3a 20 49 4e 54 45 47 45 | 52 29 20 3a 20 48 61 6e |: INTEGE|R) : Han|
|00002f50| 64 6c 65 3b 0d 0d 47 65 | 74 52 65 73 6f 75 72 63 |dle;..Ge|tResourc|
|00002f60| 65 20 72 65 74 75 72 6e | 73 20 61 20 68 61 6e 64 |e return|s a hand|
|00002f70| 6c 65 20 74 6f 20 74 68 | 65 20 72 65 73 6f 75 72 |le to th|e resour|
|00002f80| 63 65 20 68 61 76 69 6e | 67 20 74 68 65 20 67 69 |ce havin|g the gi|
|00002f90| 76 65 6e 20 74 79 70 65 | 20 61 6e 64 0d 49 44 20 |ven type| and.ID |
|00002fa0| 6e 75 6d 62 65 72 2c 20 | 72 65 61 64 69 6e 67 20 |number, |reading |
|00002fb0| 74 68 65 20 72 65 73 6f | 75 72 63 65 20 64 61 74 |the reso|urce dat|
|00002fc0| 61 20 69 6e 74 6f 20 6d | 65 6d 6f 72 79 20 69 66 |a into m|emory if|
|00002fd0| 20 69 74 27 73 20 6e 6f | 74 20 61 6c 72 65 61 64 | it's no|t alread|
|00002fe0| 79 20 69 6e 20 0d 6d 65 | 6d 6f 72 79 20 61 6e 64 |y in .me|mory and|
|00002ff0| 20 69 66 20 79 6f 75 20 | 68 61 76 65 6e 27 74 20 | if you |haven't |
|00003000| 63 61 6c 6c 65 64 20 53 | 65 74 52 65 73 4c 6f 61 |called S|etResLoa|
|00003010| 64 28 46 41 4c 53 45 29 | 20 28 73 65 65 20 74 68 |d(FALSE)| (see th|
|00003020| 65 20 77 61 72 6e 69 6e | 67 20 0d 61 62 6f 6f 76 |e warnin|g .aboov|
|00003030| 65 20 66 6f 72 20 47 65 | 74 49 6e 64 52 65 73 6f |e for Ge|tIndReso|
|00003040| 75 72 63 65 29 2e 20 20 | 47 65 74 52 65 73 6f 75 |urce). |GetResou|
|00003050| 72 63 65 20 6c 6f 6f 6b | 73 20 69 6e 20 74 68 65 |rce look|s in the|
|00003060| 20 63 75 72 72 65 6e 74 | 20 72 65 73 6f 75 72 63 | current| resourc|
|00003070| 65 20 0d 66 69 6c 65 20 | 61 6e 64 20 61 6c 6c 20 |e .file |and all |
|00003080| 72 65 73 6f 75 72 63 65 | 20 66 69 6c 65 73 20 6f |resource| files o|
|00003090| 70 65 6e 65 64 20 62 65 | 66 6f 72 65 20 69 74 2c |pened be|fore it,|
|000030a0| 20 69 6e 20 74 68 65 20 | 72 65 76 65 72 73 65 20 | in the |reverse |
|000030b0| 6f 66 20 74 68 65 20 0d | 6f 72 64 65 72 20 74 68 |of the .|order th|
|000030c0| 61 74 20 74 68 65 79 20 | 77 65 72 65 20 6f 70 65 |at they |were ope|
|000030d0| 6e 65 64 3b 20 74 68 65 | 20 73 79 73 74 65 6d 20 |ned; the| system |
|000030e0| 72 65 73 6f 75 72 63 65 | 20 66 69 6c 65 20 69 73 |resource| file is|
|000030f0| 20 73 65 61 72 63 68 65 | 64 20 6c 61 73 74 2e 20 | searche|d last. |
|00003100| 0d 49 66 20 69 74 20 64 | 6f 65 73 6e 27 74 20 66 |.If it d|oesn't f|
|00003110| 69 6e 64 20 74 68 65 20 | 72 65 73 6f 75 72 63 65 |ind the |resource|
|00003120| 2c 20 47 65 74 52 65 73 | 6f 75 72 63 65 20 72 65 |, GetRes|ource re|
|00003130| 74 75 72 6e 73 20 4e 49 | 4c 20 61 6e 64 20 74 68 |turns NI|L and th|
|00003140| 65 20 0d 52 65 73 45 72 | 72 6f 72 20 66 75 6e 63 |e .ResEr|ror func|
|00003150| 74 69 6f 6e 20 77 69 6c | 6c 20 72 65 74 75 72 6e |tion wil|l return|
|00003160| 20 74 68 65 20 72 65 73 | 75 6c 74 20 63 6f 64 65 | the res|ult code|
|00003170| 20 72 65 73 4e 6f 74 46 | 6f 75 6e 64 2e 20 20 47 | resNotF|ound. G|
|00003180| 65 74 52 65 73 6f 75 72 | 63 65 20 0d 61 6c 73 6f |etResour|ce .also|
|00003190| 20 72 65 74 75 72 6e 73 | 20 4e 49 4c 20 69 66 20 | returns| NIL if |
|000031a0| 74 68 65 20 72 65 73 6f | 75 72 63 65 20 69 73 20 |the reso|urce is |
|000031b0| 74 6f 20 62 65 20 72 65 | 61 64 20 69 6e 74 6f 20 |to be re|ad into |
|000031c0| 6d 65 6d 6f 72 79 20 62 | 75 74 20 77 6f 6e 27 74 |memory b|ut won't|
|000031d0| 20 0d 66 69 74 3b 20 69 | 6e 20 74 68 69 73 20 63 | .fit; i|n this c|
|000031e0| 61 73 65 2c 20 52 65 73 | 45 72 72 6f 72 20 77 69 |ase, Res|Error wi|
|000031f0| 6c 6c 20 72 65 74 75 72 | 6e 20 61 6e 20 61 70 70 |ll retur|n an app|
|00003200| 72 6f 70 72 69 61 74 65 | 20 4f 70 65 72 61 74 69 |ropriate| Operati|
|00003210| 6e 67 20 53 79 73 74 65 | 6d 20 0d 72 65 73 75 6c |ng Syste|m .resul|
|00003220| 74 20 63 6f 64 65 2e 20 | 0d 0d 0d 5c 20 47 65 74 |t code. |...\ Get|
|00003230| 4e 61 6d 65 64 52 65 73 | 6f 75 72 63 65 0d 31 0d |NamedRes|ource.1.|
|00003240| 46 55 4e 43 54 49 4f 4e | 20 47 65 74 4e 61 6d 65 |FUNCTION| GetName|
|00003250| 64 52 65 73 6f 75 72 63 | 65 20 28 74 68 65 54 79 |dResourc|e (theTy|
|00003260| 70 65 3a 20 52 65 73 54 | 79 70 65 3b 20 6e 61 6d |pe: ResT|ype; nam|
|00003270| 65 3a 20 53 74 72 32 35 | 35 29 20 3a 20 48 61 6e |e: Str25|5) : Han|
|00003280| 64 6c 65 3b 0d 0d 47 65 | 74 4e 61 6d 65 64 52 65 |dle;..Ge|tNamedRe|
|00003290| 73 6f 75 72 63 65 20 69 | 73 20 74 68 65 20 73 61 |source i|s the sa|
|000032a0| 6d 65 20 61 73 20 47 65 | 74 52 65 73 6f 75 72 63 |me as Ge|tResourc|
|000032b0| 65 20 28 61 62 6f 76 65 | 29 20 65 78 63 65 70 74 |e (above|) except|
|000032c0| 20 74 68 61 74 20 79 6f | 75 0d 70 61 73 73 20 61 | that yo|u.pass a|
|000032d0| 20 72 65 73 6f 75 72 63 | 65 20 6e 61 6d 65 20 69 | resourc|e name i|
|000032e0| 6e 73 74 65 61 64 20 6f | 66 20 61 6e 20 49 44 20 |nstead o|f an ID |
|000032f0| 6e 75 6d 62 65 72 2e 20 | 0d 0d 0d 5c 20 4c 6f 61 |number. |...\ Loa|
|00003300| 64 52 65 73 6f 75 72 63 | 65 0d 31 0d 50 52 4f 43 |dResourc|e.1.PROC|
|00003310| 45 44 55 52 45 20 4c 6f | 61 64 52 65 73 6f 75 72 |EDURE Lo|adResour|
|00003320| 63 65 20 28 74 68 65 52 | 65 73 6f 75 72 63 65 3a |ce (theR|esource:|
|00003330| 20 48 61 6e 64 6c 65 29 | 3b 0d 0d 47 69 76 65 6e | Handle)|;..Given|
|00003340| 20 61 20 68 61 6e 64 6c | 65 20 74 6f 20 61 20 72 | a handl|e to a r|
|00003350| 65 73 6f 75 72 63 65 20 | 28 72 65 74 75 72 6e 65 |esource |(returne|
|00003360| 64 20 62 79 20 47 65 74 | 49 6e 64 52 65 73 6f 75 |d by Get|IndResou|
|00003370| 72 63 65 2c 20 47 65 74 | 52 65 73 6f 75 72 63 65 |rce, Get|Resource|
|00003380| 2c 0d 6f 72 20 47 65 74 | 4e 61 6d 65 64 52 65 73 |,.or Get|NamedRes|
|00003390| 6f 75 72 63 65 29 2c 20 | 4c 6f 61 64 52 65 73 6f |ource), |LoadReso|
|000033a0| 75 72 63 65 20 72 65 61 | 64 73 20 74 68 61 74 20 |urce rea|ds that |
|000033b0| 72 65 73 6f 75 72 63 65 | 20 69 6e 74 6f 20 6d 65 |resource| into me|
|000033c0| 6d 6f 72 79 2e 20 20 49 | 74 0d 64 6f 65 73 20 6e |mory. I|t.does n|
|000033d0| 6f 74 68 69 6e 67 20 69 | 66 20 74 68 65 20 72 65 |othing i|f the re|
|000033e0| 73 6f 75 72 63 65 20 69 | 73 20 61 6c 72 65 61 64 |source i|s alread|
|000033f0| 79 20 69 6e 20 6d 65 6d | 6f 72 79 20 6f 72 20 69 |y in mem|ory or i|
|00003400| 66 20 20 74 68 65 20 67 | 69 76 65 6e 0d 68 61 6e |f the g|iven.han|
|00003410| 64 6c 65 20 69 73 6e 27 | 74 20 61 20 68 61 6e 64 |dle isn'|t a hand|
|00003420| 6c 65 20 74 6f 20 61 20 | 72 65 73 6f 75 72 63 65 |le to a |resource|
|00003430| 3b 20 69 6e 20 74 68 65 | 20 6c 61 74 74 65 72 20 |; in the| latter |
|00003440| 63 61 73 65 2c 20 74 68 | 65 20 52 65 73 45 72 72 |case, th|e ResErr|
|00003450| 6f 72 0d 66 75 6e 63 74 | 69 6f 6e 20 77 69 6c 6c |or.funct|ion will|
|00003460| 20 72 65 74 75 72 6e 20 | 74 68 65 20 72 65 73 75 | return |the resu|
|00003470| 6c 74 20 63 6f 64 65 20 | 72 65 73 4e 6f 74 46 6f |lt code |resNotFo|
|00003480| 75 6e 64 2e 20 20 43 61 | 6c 6c 20 74 68 69 73 20 |und. Ca|ll this |
|00003490| 70 72 6f 63 65 64 75 72 | 65 0d 69 66 20 79 6f 75 |procedur|e.if you|
|000034a0| 20 77 61 6e 74 20 74 6f | 20 61 63 63 65 73 73 20 | want to| access |
|000034b0| 74 68 65 20 64 61 74 61 | 20 66 6f 72 20 61 20 72 |the data| for a r|
|000034c0| 65 73 6f 75 72 63 65 20 | 74 68 72 6f 75 67 68 20 |esource |through |
|000034d0| 69 74 73 20 68 61 6e 64 | 6c 65 20 61 6e 64 0d 65 |its hand|le and.e|
|000034e0| 69 74 68 65 72 20 79 6f | 75 27 76 65 20 63 61 6c |ither yo|u've cal|
|000034f0| 6c 65 64 20 53 65 74 52 | 65 73 4c 6f 61 64 28 46 |led SetR|esLoad(F|
|00003500| 41 4c 53 45 29 20 6f 72 | 20 69 66 20 74 68 65 20 |ALSE) or| if the |
|00003510| 72 65 73 6f 75 72 63 65 | 20 69 73 20 70 75 72 67 |resource| is purg|
|00003520| 65 61 62 6c 65 2e 0d 0d | 49 66 20 79 6f 75 27 76 |eable...|If you'v|
|00003530| 65 20 63 68 61 6e 67 65 | 64 20 74 68 65 20 72 65 |e change|d the re|
|00003540| 73 6f 75 72 63 65 20 64 | 61 74 61 20 66 6f 72 20 |source d|ata for |
|00003550| 61 20 70 75 72 67 65 61 | 62 6c 65 20 72 65 73 6f |a purgea|ble reso|
|00003560| 75 72 63 65 20 61 6e 64 | 20 74 68 65 20 0d 72 65 |urce and| the .re|
|00003570| 73 6f 75 72 63 65 20 69 | 73 20 70 75 72 67 65 64 |source i|s purged|
|00003580| 20 62 65 66 6f 72 65 20 | 62 65 69 6e 67 20 77 72 | before |being wr|
|00003590| 69 74 74 65 6e 20 74 6f | 20 74 68 65 20 72 65 73 |itten to| the res|
|000035a0| 6f 75 72 63 65 20 66 69 | 6c 65 2c 20 74 68 65 20 |ource fi|le, the |
|000035b0| 0d 63 68 61 6e 67 65 73 | 20 77 69 6c 6c 20 62 65 |.changes| will be|
|000035c0| 20 6c 6f 73 74 3b 20 4c | 6f 61 64 52 65 73 6f 75 | lost; L|oadResou|
|000035d0| 72 63 65 20 77 69 6c 6c | 20 72 65 72 65 61 64 20 |rce will| reread |
|000035e0| 74 68 65 20 6f 72 69 67 | 69 6e 61 6c 20 72 65 73 |the orig|inal res|
|000035f0| 6f 75 72 63 65 20 0d 66 | 72 6f 6d 20 74 68 65 20 |ource .f|rom the |
|00003600| 72 65 73 6f 75 72 63 65 | 20 66 69 6c 65 2e 20 20 |resource| file. |
|00003610| 53 65 65 20 74 68 65 20 | 64 65 73 63 72 69 70 74 |See the |descript|
|00003620| 69 6f 6e 73 20 6f 66 20 | 43 68 61 6e 67 65 64 52 |ions of |ChangedR|
|00003630| 65 73 6f 75 72 63 65 20 | 61 6e 64 0d 53 65 74 52 |esource |and.SetR|
|00003640| 65 73 50 75 72 67 65 20 | 66 6f 72 20 69 6e 66 6f |esPurge |for info|
|00003650| 72 6d 61 74 69 6f 6e 20 | 61 62 6f 75 74 20 68 6f |rmation |about ho|
|00003660| 77 20 74 6f 20 65 6e 73 | 75 72 65 20 74 68 61 74 |w to ens|ure that|
|00003670| 20 63 68 61 6e 67 65 73 | 20 6d 61 64 65 20 74 6f | changes| made to|
|00003680| 0d 70 75 72 67 65 61 62 | 6c 65 20 72 65 73 6f 75 |.purgeab|le resou|
|00003690| 72 63 65 73 20 77 69 6c | 6c 20 62 65 20 77 72 69 |rces wil|l be wri|
|000036a0| 74 74 65 6e 20 74 6f 20 | 74 68 65 20 72 65 73 65 |tten to |the rese|
|000036b0| 61 72 63 68 20 66 69 6c | 65 2e 0d 0d 0d 5c 20 52 |arch fil|e....\ R|
|000036c0| 65 6c 65 61 73 65 52 65 | 73 6f 75 72 63 65 0d 31 |eleaseRe|source.1|
|000036d0| 0d 50 52 4f 43 45 44 55 | 52 45 20 52 65 6c 65 61 |.PROCEDU|RE Relea|
|000036e0| 73 65 52 65 73 6f 75 72 | 63 65 20 28 74 68 65 52 |seResour|ce (theR|
|000036f0| 65 73 6f 75 72 63 65 3a | 20 48 61 6e 64 6c 65 29 |esource:| Handle)|
|00003700| 3b 0d 0d 47 69 76 65 6e | 20 61 20 68 61 6e 64 6c |;..Given| a handl|
|00003710| 65 20 74 6f 20 61 20 72 | 65 73 6f 75 72 63 65 2c |e to a r|esource,|
|00003720| 20 52 65 6c 65 61 73 65 | 52 65 73 6f 75 72 63 65 | Release|Resource|
|00003730| 20 72 65 6c 65 61 73 65 | 73 20 74 68 65 20 6d 65 | release|s the me|
|00003740| 6d 6f 72 79 0d 6f 63 63 | 75 70 69 65 64 20 62 79 |mory.occ|upied by|
|00003750| 20 74 68 65 20 72 65 73 | 6f 75 72 63 65 20 64 61 | the res|ource da|
|00003760| 74 61 2c 20 69 66 20 61 | 6e 79 2c 20 61 6e 64 20 |ta, if a|ny, and |
|00003770| 72 65 70 6c 61 63 65 73 | 20 74 68 65 20 68 61 6e |replaces| the han|
|00003780| 64 6c 65 20 74 6f 20 74 | 68 61 74 0d 72 65 73 6f |dle to t|hat.reso|
|00003790| 75 72 63 65 20 69 6e 20 | 74 68 65 20 72 65 73 6f |urce in |the reso|
|000037a0| 75 72 63 65 20 6d 61 70 | 20 77 69 74 68 20 4e 49 |urce map| with NI|
|000037b0| 4c 2e 20 20 28 53 65 65 | 20 46 69 67 75 72 65 20 |L. (See| Figure |
|000037c0| 37 2e 29 20 20 54 68 65 | 20 67 69 76 65 6e 20 0d |7.) The| given .|
|000037d0| 68 61 6e 64 6c 65 20 77 | 69 6c 6c 20 6e 6f 20 6c |handle w|ill no l|
|000037e0| 6f 6e 67 65 72 20 62 65 | 20 72 65 63 6f 67 6e 69 |onger be| recogni|
|000037f0| 7a 65 64 20 61 73 20 61 | 20 68 61 6e 64 6c 65 20 |zed as a| handle |
|00003800| 74 6f 20 61 20 72 65 73 | 6f 75 72 63 65 3b 20 69 |to a res|ource; i|
|00003810| 66 20 74 68 65 20 0d 52 | 65 73 6f 75 72 63 65 20 |f the .R|esource |
|00003820| 4d 61 6e 61 67 65 72 20 | 69 73 20 73 75 62 73 65 |Manager |is subse|
|00003830| 71 75 65 6e 74 6c 79 20 | 63 61 6c 6c 65 64 20 74 |quently |called t|
|00003840| 6f 20 67 65 74 20 74 68 | 65 20 72 65 6c 65 61 73 |o get th|e releas|
|00003850| 65 64 20 72 65 73 6f 75 | 72 63 65 2c 20 61 0d 6e |ed resou|rce, a.n|
|00003860| 65 77 20 68 61 6e 64 6c | 65 20 77 69 6c 6c 20 62 |ew handl|e will b|
|00003870| 65 20 61 6c 6c 6f 63 61 | 74 65 64 2e 20 20 55 73 |e alloca|ted. Us|
|00003880| 65 20 74 68 69 73 20 70 | 72 6f 63 65 64 75 72 65 |e this p|rocedure|
|00003890| 20 6f 6e 6c 79 20 61 66 | 74 65 72 20 79 6f 75 27 | only af|ter you'|
|000038a0| 72 65 0d 63 6f 6d 70 6c | 65 74 65 6c 79 20 74 68 |re.compl|etely th|
|000038b0| 72 6f 75 67 68 20 77 69 | 74 68 20 61 20 72 65 73 |rough wi|th a res|
|000038c0| 6f 75 72 63 65 2e 0d 0d | 0d 5c 20 44 65 74 61 63 |ource...|.\ Detac|
|000038d0| 68 20 52 65 73 6f 75 72 | 63 65 0d 31 0d 50 52 4f |h Resour|ce.1.PRO|
|000038e0| 43 45 44 55 52 45 20 44 | 65 74 61 63 68 52 65 73 |CEDURE D|etachRes|
|000038f0| 6f 75 72 63 65 20 28 74 | 68 65 52 65 73 6f 75 72 |ource (t|heResour|
|00003900| 63 65 3a 20 48 61 6e 64 | 6c 65 29 3b 0d 0d 47 69 |ce: Hand|le);..Gi|
|00003910| 76 65 6e 20 61 20 68 61 | 6e 64 6c 65 20 74 6f 20 |ven a ha|ndle to |
|00003920| 61 20 72 65 73 6f 75 72 | 63 65 2c 20 44 65 74 61 |a resour|ce, Deta|
|00003930| 63 68 52 65 73 6f 75 72 | 63 65 20 72 65 70 6c 61 |chResour|ce repla|
|00003940| 63 65 73 20 74 68 65 20 | 68 61 6e 64 6c 65 20 74 |ces the |handle t|
|00003950| 6f 0d 74 68 61 74 20 72 | 65 73 6f 75 72 63 65 20 |o.that r|esource |
|00003960| 69 6e 20 74 68 65 20 72 | 65 73 6f 75 72 63 65 20 |in the r|esource |
|00003970| 6d 61 70 20 77 69 74 68 | 20 4e 49 4c 2e 20 20 28 |map with| NIL. (|
|00003980| 53 65 65 20 46 69 67 75 | 72 65 20 37 20 61 62 6f |See Figu|re 7 abo|
|00003990| 76 65 2e 29 20 20 54 68 | 65 0d 67 69 76 65 6e 20 |ve.) Th|e.given |
|000039a0| 68 61 6e 64 6c 65 20 77 | 69 6c 6c 20 6e 6f 20 6c |handle w|ill no l|
|000039b0| 6f 6e 67 65 72 20 62 65 | 20 72 65 63 6f 67 6e 69 |onger be| recogni|
|000039c0| 7a 65 64 20 61 73 20 61 | 20 68 61 6e 64 6c 65 20 |zed as a| handle |
|000039d0| 74 6f 20 61 20 72 65 73 | 6f 75 72 63 65 3b 20 69 |to a res|ource; i|
|000039e0| 66 0d 74 68 65 20 52 65 | 73 6f 75 72 63 65 20 4d |f.the Re|source M|
|000039f0| 61 6e 61 67 65 72 20 69 | 73 20 73 75 62 73 65 71 |anager i|s subseq|
|00003a00| 75 65 6e 74 6c 79 20 63 | 61 6c 6c 65 64 20 74 6f |uently c|alled to|
|00003a10| 20 67 65 74 20 74 68 65 | 20 64 65 74 61 63 68 65 | get the| detache|
|00003a20| 64 0d 72 65 73 6f 75 72 | 63 65 2c 20 61 20 6e 65 |d.resour|ce, a ne|
|00003a30| 77 20 68 61 6e 64 6c 65 | 20 77 69 6c 6c 20 62 65 |w handle| will be|
|00003a40| 20 61 6c 6c 6f 63 61 74 | 65 64 2e 0d 0d 44 65 74 | allocat|ed...Det|
|00003a50| 61 63 68 52 65 73 6f 75 | 72 63 65 20 69 73 20 75 |achResou|rce is u|
|00003a60| 73 65 66 75 6c 20 69 66 | 20 79 6f 75 20 77 61 6e |seful if| you wan|
|00003a70| 74 20 74 68 65 20 72 65 | 73 6f 75 72 63 65 20 64 |t the re|source d|
|00003a80| 61 74 61 20 74 6f 20 62 | 65 20 61 63 63 65 73 73 |ata to b|e access|
|00003a90| 65 64 0d 6f 6e 6c 79 20 | 62 79 20 79 6f 75 72 73 |ed.only |by yours|
|00003aa0| 65 6c 66 20 74 68 72 6f | 75 67 68 20 74 68 65 20 |elf thro|ugh the |
|00003ab0| 67 69 76 65 6e 20 68 61 | 6e 64 6c 65 20 61 6e 64 |given ha|ndle and|
|00003ac0| 20 6e 6f 74 20 62 79 20 | 74 68 65 20 52 65 73 6f | not by |the Reso|
|00003ad0| 75 72 63 65 0d 4d 61 6e | 61 67 65 72 2e 20 20 44 |urce.Man|ager. D|
|00003ae0| 65 74 61 63 68 52 65 73 | 6f 75 72 63 65 20 69 73 |etachRes|ource is|
|00003af0| 20 61 6c 73 6f 20 75 73 | 65 66 75 6c 20 69 6e 20 | also us|eful in |
|00003b00| 74 68 65 20 75 6e 75 73 | 75 61 6c 20 63 61 73 65 |the unus|ual case|
|00003b10| 20 74 68 61 74 20 79 6f | 75 0d 64 6f 6e 27 74 20 | that yo|u.don't |
|00003b20| 77 61 6e 74 20 61 20 72 | 65 73 6f 75 72 63 65 20 |want a r|esource |
|00003b30| 74 6f 20 62 65 20 72 65 | 6c 65 61 73 65 64 20 77 |to be re|leased w|
|00003b40| 68 65 6e 20 61 20 72 65 | 73 6f 75 72 63 65 20 66 |hen a re|source f|
|00003b50| 69 6c 65 20 69 73 20 63 | 6c 6f 73 65 64 2e 20 0d |ile is c|losed. .|
|00003b60| 54 6f 20 63 6f 70 79 20 | 61 20 72 65 73 6f 75 72 |To copy |a resour|
|00003b70| 63 65 2c 20 79 6f 75 20 | 63 61 6e 20 63 61 6c 6c |ce, you |can call|
|00003b80| 20 44 65 74 61 63 68 52 | 65 73 6f 75 72 63 65 20 | DetachR|esource |
|00003b90| 66 6f 6c 6c 6f 77 65 64 | 20 62 79 20 41 64 64 52 |followed| by AddR|
|00003ba0| 65 73 6f 75 72 63 65 0d | 28 77 69 74 68 20 61 20 |esource.|(with a |
|00003bb0| 6e 65 77 20 72 65 73 6f | 75 72 63 65 20 49 44 29 |new reso|urce ID)|
|00003bc0| 2e 0d 0d 49 66 20 74 68 | 65 20 67 69 76 65 6e 20 |...If th|e given |
|00003bd0| 68 61 6e 64 6c 65 20 69 | 73 6e 27 74 20 61 20 68 |handle i|sn't a h|
|00003be0| 61 6e 64 6c 65 20 74 6f | 20 61 20 72 65 73 6f 75 |andle to| a resou|
|00003bf0| 72 63 65 2c 20 44 65 74 | 61 63 68 52 65 73 6f 70 |rce, Det|achResop|
|00003c00| 75 72 63 65 20 77 69 6c | 6c 20 0d 64 6f 20 6e 6f |urce wil|l .do no|
|00003c10| 74 68 69 6e 67 20 61 6e | 64 20 74 68 65 20 52 65 |thing an|d the Re|
|00003c20| 73 45 72 72 6f 72 20 66 | 75 6e 63 74 69 6f 6e 20 |sError f|unction |
|00003c30| 77 69 6c 6c 20 72 65 74 | 75 72 6e 20 74 68 65 20 |will ret|urn the |
|00003c40| 72 65 73 75 6c 74 20 63 | 6f 64 65 0d 72 65 73 4e |result c|ode.resN|
|00003c50| 6f 74 46 6f 75 6e 64 2e | 0d 0d 0d 5c 20 55 6e 69 |otFound.|...\ Uni|
|00003c60| 71 75 65 49 44 0d 31 0d | 46 55 4e 43 54 49 4f 4e |queID.1.|FUNCTION|
|00003c70| 20 55 6e 69 71 75 65 49 | 44 20 28 74 68 65 54 79 | UniqueI|D (theTy|
|00003c80| 70 65 3a 20 52 65 73 54 | 79 70 65 29 20 3a 20 49 |pe: ResT|ype) : I|
|00003c90| 4e 54 45 47 45 52 3b 0d | 0d 55 6e 69 71 75 65 49 |NTEGER;.|.UniqueI|
|00003ca0| 44 20 72 65 74 75 72 6e | 73 20 61 6e 20 49 44 20 |D return|s an ID |
|00003cb0| 6e 75 6d 62 65 72 20 67 | 72 65 61 74 65 72 20 74 |number g|reater t|
|00003cc0| 68 61 6e 20 af 20 74 68 | 61 74 20 69 73 6e 27 74 |han . th|at isn't|
|00003cd0| 20 63 75 72 72 65 6e 74 | 6c 79 0d 61 73 73 69 67 | current|ly.assig|
|00003ce0| 6e 65 64 20 74 6f 20 61 | 6e 79 20 72 65 73 6f 75 |ned to a|ny resou|
|00003cf0| 72 63 65 20 6f 66 20 74 | 68 65 20 67 69 76 65 6e |rce of t|he given|
|00003d00| 20 74 79 70 65 20 69 6e | 20 61 6e 79 20 6f 70 65 | type in| any ope|
|00003d10| 6e 20 72 65 73 6f 75 72 | 63 65 20 66 69 6c 65 2e |n resour|ce file.|
|00003d20| 0d 55 73 69 6e 67 20 74 | 68 69 73 20 6e 75 6d 62 |.Using t|his numb|
|00003d30| 65 72 20 77 68 65 6e 20 | 79 6f 75 20 61 64 64 20 |er when |you add |
|00003d40| 61 20 6e 65 77 20 72 65 | 73 6f 75 72 63 65 20 74 |a new re|source t|
|00003d50| 6f 20 61 20 72 65 73 6f | 75 72 63 65 20 66 69 6c |o a reso|urce fil|
|00003d60| 65 20 0d 65 6e 73 75 72 | 65 73 20 74 68 61 74 20 |e .ensur|es that |
|00003d70| 79 6f 75 20 77 6f 6e 27 | 74 20 64 75 70 6c 69 63 |you won'|t duplic|
|00003d80| 61 74 65 20 61 20 72 65 | 73 6f 75 72 63 65 20 49 |ate a re|source I|
|00003d90| 44 20 61 6e 64 20 6f 76 | 65 72 72 69 64 65 20 61 |D and ov|erride a|
|00003da0| 6e 20 65 78 69 73 74 69 | 6e 67 20 0d 72 65 73 6f |n existi|ng .reso|
|00003db0| 75 72 63 65 2e 20 0d 0d | 28 77 61 72 6e 69 6e 67 |urce. ..|(warning|
|00003dc0| 29 0d 09 49 74 27 73 20 | 70 6f 73 73 69 62 6c 65 |)..It's |possible|
|00003dd0| 20 74 68 61 74 20 55 6e | 69 71 75 65 49 44 20 77 | that Un|iqueID w|
|00003de0| 69 6c 6c 20 72 65 74 75 | 72 6e 20 61 6e 20 49 44 |ill retu|rn an ID|
|00003df0| 20 69 6e 20 74 68 65 20 | 0d 09 72 61 6e 67 65 20 | in the |..range |
|00003e00| 72 65 73 65 72 76 65 64 | 20 66 6f 72 20 73 79 73 |reserved| for sys|
|00003e10| 74 65 6d 20 72 65 73 6f | 75 72 63 65 73 20 28 af |tem reso|urces (.|
|00003e20| 20 74 6f 20 31 32 37 29 | 2e 20 20 59 6f 75 0d 09 | to 127)|. You..|
|00003e30| 73 68 6f 75 6c 64 20 63 | 68 65 63 6b 20 74 68 61 |should c|heck tha|
|00003e40| 74 20 74 68 65 20 49 44 | 20 72 65 74 75 72 6e 65 |t the ID| returne|
|00003e50| 64 20 69 73 20 67 72 65 | 61 74 65 72 20 74 68 61 |d is gre|ater tha|
|00003e60| 6e 20 31 32 37 3b 20 69 | 66 0d 09 69 74 20 69 73 |n 127; i|f..it is|
|00003e70| 6e 27 74 2c 20 63 61 6c | 6c 20 55 6e 69 71 75 65 |n't, cal|l Unique|
|00003e80| 49 44 20 61 67 61 69 6e | 2e 0d 09 0d 09 0d 5c 20 |ID again|......\ |
|00003e90| 47 65 74 52 65 73 49 6e | 66 6f 0d 31 0d 50 52 4f |GetResIn|fo.1.PRO|
|00003ea0| 43 45 44 55 52 45 20 47 | 65 74 52 65 73 49 6e 66 |CEDURE G|etResInf|
|00003eb0| 6f 20 28 74 68 65 52 65 | 73 6f 75 72 63 65 3a 20 |o (theRe|source: |
|00003ec0| 48 61 6e 64 6c 65 3b 20 | 56 41 52 20 74 68 65 20 |Handle; |VAR the |
|00003ed0| 49 44 3a 20 49 4e 54 45 | 47 45 52 3b 20 56 41 52 |ID: INTE|GER; VAR|
|00003ee0| 0d 09 09 74 68 65 54 79 | 70 65 3a 20 52 65 73 54 |...theTy|pe: ResT|
|00003ef0| 79 70 65 3b 20 56 41 52 | 20 6e 61 6d 65 3a 20 53 |ype; VAR| name: S|
|00003f00| 74 72 32 35 35 29 3b 0d | 09 09 0d 47 69 76 65 6e |tr255);.|...Given|
|00003f10| 20 61 20 68 61 6e 64 6c | 65 20 74 6f 20 61 20 72 | a handl|e to a r|
|00003f20| 65 73 6f 75 72 63 65 2c | 20 47 65 74 52 65 73 49 |esource,| GetResI|
|00003f30| 6e 66 6f 20 72 65 74 75 | 72 6e 73 20 74 68 65 20 |nfo retu|rns the |
|00003f40| 49 44 20 6e 75 6d 62 65 | 72 2c 20 74 79 70 65 2c |ID numbe|r, type,|
|00003f50| 0d 61 6e 64 20 6e 61 6d | 65 20 6f 66 20 74 68 65 |.and nam|e of the|
|00003f60| 20 72 65 73 6f 75 72 63 | 65 2e 20 20 49 66 20 74 | resourc|e. If t|
|00003f70| 68 65 20 67 69 76 65 6e | 20 68 61 6e 64 6c 65 20 |he given| handle |
|00003f80| 69 73 6e 27 74 20 61 20 | 68 61 6e 64 6c 65 20 74 |isn't a |handle t|
|00003f90| 6f 20 61 20 0d 72 65 73 | 6f 75 72 63 65 2c 20 47 |o a .res|ource, G|
|00003fa0| 65 74 52 65 73 49 6e 66 | 6f 20 77 69 6c 6c 20 64 |etResInf|o will d|
|00003fb0| 6f 20 6e 6f 74 68 69 6e | 67 20 61 6e 64 20 74 68 |o nothin|g and th|
|00003fc0| 65 20 52 65 73 45 72 72 | 6f 72 20 66 75 6e 63 74 |e ResErr|or funct|
|00003fd0| 69 6f 6e 20 77 69 6c 6c | 20 0d 72 65 74 75 72 6e |ion will| .return|
|00003fe0| 20 74 68 65 20 72 65 73 | 75 6c 74 20 63 6f 64 65 | the res|ult code|
|00003ff0| 20 72 65 73 4e 6f 74 46 | 6f 75 6e 64 2e 20 0d 0d | resNotF|ound. ..|
|00004000| 0d 5c 20 47 65 74 52 65 | 73 41 74 74 72 73 0d 31 |.\ GetRe|sAttrs.1|
|00004010| 0d 46 55 4e 43 54 49 4f | 4e 20 47 65 74 52 65 73 |.FUNCTIO|N GetRes|
|00004020| 41 74 74 72 73 20 28 74 | 68 65 52 65 73 6f 75 72 |Attrs (t|heResour|
|00004030| 63 65 3a 20 48 61 6e 64 | 6c 65 29 20 3a 20 49 4e |ce: Hand|le) : IN|
|00004040| 54 45 47 45 52 3b 0d 0d | 47 69 76 65 6e 20 61 20 |TEGER;..|Given a |
|00004050| 68 61 6e 64 6c 65 20 74 | 6f 20 61 20 72 65 73 6f |handle t|o a reso|
|00004060| 75 72 63 65 2c 20 47 65 | 74 52 65 73 41 74 74 72 |urce, Ge|tResAttr|
|00004070| 73 20 72 65 74 75 72 6e | 73 20 74 68 65 20 72 65 |s return|s the re|
|00004080| 73 6f 75 72 63 65 0d 61 | 74 74 72 69 62 75 74 65 |source.a|ttribute|
|00004090| 73 20 66 6f 72 20 74 68 | 65 20 72 65 73 6f 75 72 |s for th|e resour|
|000040a0| 63 65 2e 20 20 28 52 65 | 73 6f 75 72 63 65 20 61 |ce. (Re|source a|
|000040b0| 74 74 72 69 62 75 74 65 | 73 20 61 72 65 20 64 65 |ttribute|s are de|
|000040c0| 73 63 72 69 62 65 64 20 | 61 62 6f 76 65 0d 75 6e |scribed |above.un|
|000040d0| 64 65 72 20 22 52 65 73 | 6f 75 72 63 65 20 52 65 |der "Res|ource Re|
|000040e0| 66 65 72 65 6e 63 65 73 | 22 2e 29 20 20 49 66 20 |ferences|".) If |
|000040f0| 74 68 65 20 67 69 76 65 | 6e 20 68 61 6e 64 6c 65 |the give|n handle|
|00004100| 20 69 73 6e 27 74 20 61 | 20 68 61 6e 64 6c 65 20 | isn't a| handle |
|00004110| 74 6f 20 61 0d 72 65 73 | 6f 75 72 63 65 2c 20 47 |to a.res|ource, G|
|00004120| 65 74 52 65 73 41 74 74 | 72 73 20 77 69 6c 6c 20 |etResAtt|rs will |
|00004130| 64 6f 20 6e 6f 74 68 69 | 6e 67 20 61 6e 64 20 74 |do nothi|ng and t|
|00004140| 68 65 20 52 65 73 45 72 | 72 6f 72 20 66 75 6e 63 |he ResEr|ror func|
|00004150| 74 69 6f 6e 20 77 69 6c | 6c 20 0d 72 65 74 75 72 |tion wil|l .retur|
|00004160| 6e 20 74 68 65 20 72 65 | 73 75 6c 74 20 63 6f 64 |n the re|sult cod|
|00004170| 65 20 72 65 73 4e 6f 74 | 46 6f 75 6e 64 2e 20 0d |e resNot|Found. .|
|00004180| 0d 0d 5c 20 53 69 7a 65 | 52 65 73 6f 75 72 63 65 |..\ Size|Resource|
|00004190| 0d 31 0d 46 55 4e 43 54 | 49 4f 4e 20 53 69 7a 65 |.1.FUNCT|ION Size|
|000041a0| 52 65 73 6f 75 72 63 65 | 20 28 74 68 65 20 52 65 |Resource| (the Re|
|000041b0| 73 6f 75 72 63 65 3a 20 | 48 61 6e 64 6c 65 29 20 |source: |Handle) |
|000041c0| 3a 20 4c 4f 4e 47 49 4e | 54 3b 0d 0d 47 69 76 65 |: LONGIN|T;..Give|
|000041d0| 6e 20 61 20 68 61 6e 64 | 6c 65 20 74 6f 20 61 20 |n a hand|le to a |
|000041e0| 72 65 73 6f 75 72 63 65 | 2c 20 53 69 7a 65 20 52 |resource|, Size R|
|000041f0| 65 73 6f 75 72 63 65 20 | 72 65 74 75 72 6e 73 20 |esource |returns |
|00004200| 74 68 65 20 73 69 7a 65 | 20 69 6e 20 62 79 74 65 |the size| in byte|
|00004210| 73 20 6f 66 20 0d 74 68 | 65 20 72 65 73 6f 75 72 |s of .th|e resour|
|00004220| 63 65 20 69 6e 20 74 68 | 65 20 72 65 73 6f 75 72 |ce in th|e resour|
|00004230| 63 65 20 66 69 6c 65 2e | 20 20 49 66 20 74 68 65 |ce file.| If the|
|00004240| 20 67 69 76 65 6e 20 68 | 61 6e 64 6c 65 20 69 73 | given h|andle is|
|00004250| 6e 27 74 20 61 20 68 61 | 6e 64 6c 65 20 0d 74 6f |n't a ha|ndle .to|
|00004260| 20 61 20 72 65 73 6f 75 | 72 63 65 2c 20 53 69 7a | a resou|rce, Siz|
|00004270| 65 52 65 73 6f 75 72 63 | 65 20 77 69 6c 6c 20 72 |eResourc|e will r|
|00004280| 65 74 75 72 6e 20 2d 31 | 20 61 6e 64 20 74 68 65 |eturn -1| and the|
|00004290| 20 52 65 73 45 72 72 6f | 72 20 66 75 6e 63 74 69 | ResErro|r functi|
|000042a0| 6f 6e 20 0d 77 69 6c 6c | 20 72 65 74 75 72 6e 20 |on .will| return |
|000042b0| 74 68 65 20 72 65 73 75 | 6c 74 20 63 6f 64 65 20 |the resu|lt code |
|000042c0| 72 65 73 4e 6f 74 46 6f | 75 6e 64 2e 20 20 49 74 |resNotFo|und. It|
|000042d0| 27 73 20 61 20 67 6f 6f | 64 20 69 64 65 61 20 74 |'s a goo|d idea t|
|000042e0| 6f 20 63 61 6c 6c 0d 53 | 69 7a 65 52 65 73 6f 75 |o call.S|izeResou|
|000042f0| 72 63 65 20 61 6e 64 20 | 65 6e 73 75 72 65 20 74 |rce and |ensure t|
|00004300| 68 61 74 20 73 75 66 66 | 69 63 69 65 6e 74 20 73 |hat suff|icient s|
|00004310| 70 61 63 65 20 69 73 20 | 61 76 61 69 6c 61 62 6c |pace is |availabl|
|00004320| 65 20 62 65 66 6f 72 65 | 20 0d 72 65 61 64 69 6e |e before| .readin|
|00004330| 67 20 61 20 72 65 73 6f | 75 72 63 65 20 69 6e 74 |g a reso|urce int|
|00004340| 6f 20 6d 65 6d 6f 72 79 | 2e 0d 0d 0d 5c 20 53 65 |o memory|....\ Se|
|00004350| 74 52 65 73 49 6e 66 6f | 0d 31 0d 50 52 4f 43 45 |tResInfo|.1.PROCE|
|00004360| 44 55 52 45 20 53 65 74 | 52 65 73 49 6e 66 6f 20 |DURE Set|ResInfo |
|00004370| 28 74 68 65 52 65 73 6f | 75 72 63 65 3a 20 48 61 |(theReso|urce: Ha|
|00004380| 6e 64 6c 65 3b 20 74 68 | 65 49 44 3a 20 49 4e 54 |ndle; th|eID: INT|
|00004390| 45 47 45 52 3b 20 6e 61 | 6d 65 3a 0d 09 60 09 53 |EGER; na|me:..`.S|
|000043a0| 74 72 32 35 35 29 3b 0d | 09 0d 47 69 76 65 6e 20 |tr255);.|..Given |
|000043b0| 61 20 68 61 6e 64 6c 65 | 20 74 6f 20 61 20 72 65 |a handle| to a re|
|000043c0| 73 6f 75 72 63 65 2c 20 | 53 65 74 52 65 73 49 6e |source, |SetResIn|
|000043d0| 66 6f 20 63 68 61 6e 67 | 65 73 20 74 68 65 20 49 |fo chang|es the I|
|000043e0| 44 20 6e 75 6d 62 65 72 | 20 61 6e 64 20 6e 61 6d |D number| and nam|
|000043f0| 65 20 0d 6f 66 20 74 68 | 65 20 72 65 73 6f 75 72 |e .of th|e resour|
|00004400| 63 65 20 74 6f 20 74 68 | 65 20 67 69 76 65 6e 20 |ce to th|e given |
|00004410| 49 44 20 6e 75 6d 62 65 | 72 20 61 6e 64 20 6e 61 |ID numbe|r and na|
|00004420| 6d 65 2e 0d 09 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |me...___|________|
|00004430| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004440| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004450| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004460| 5f 5f 5f 5f 0d 09 41 73 | 73 65 6d 62 6c 79 2d 6c |____..As|sembly-l|
|00004470| 61 6e 67 75 61 67 65 20 | 6e 6f 74 65 3a 20 20 49 |anguage |note: I|
|00004480| 66 20 79 6f 75 20 70 61 | 73 73 20 4e 49 4c 20 66 |f you pa|ss NIL f|
|00004490| 6f 72 20 74 68 65 20 6e | 61 6d 65 20 70 61 72 61 |or the n|ame para|
|000044a0| 6d 65 74 65 72 2c 20 0d | 09 74 68 65 20 6e 61 6d |meter, .|.the nam|
|000044b0| 65 20 77 69 6c 6c 20 6e | 6f 74 20 62 65 20 63 68 |e will n|ot be ch|
|000044c0| 61 6e 67 65 64 2e 0d 09 | 5f 5f 5f 5f 5f 5f 5f 5f |anged...|________|
|000044d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000044e0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000044f0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004500| 5f 5f 5f 5f 5f 5f 5f 0d | 09 0d 28 77 61 72 6e 69 |_______.|..(warni|
|00004510| 6e 67 29 0d 09 49 74 27 | 73 20 61 20 64 61 6e 67 |ng)..It'|s a dang|
|00004520| 65 72 6f 75 73 20 70 72 | 61 63 74 69 63 65 20 74 |erous pr|actice t|
|00004530| 6f 20 63 68 61 6e 67 65 | 20 74 68 65 20 49 44 20 |o change| the ID |
|00004540| 6e 75 6d 62 65 72 20 61 | 6e 64 0d 09 6e 61 6d 65 |number a|nd..name|
|00004550| 20 6f 66 20 61 20 73 79 | 73 74 65 6d 20 72 65 73 | of a sy|stem res|
|00004560| 6f 75 72 63 65 2c 20 62 | 65 63 61 75 73 65 20 6f |ource, b|ecause o|
|00004570| 74 68 65 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |ther app|lication|
|00004580| 73 20 6d 61 79 0d 09 61 | 6c 72 65 61 64 79 20 61 |s may..a|lready a|
|00004590| 63 63 65 73 73 20 74 68 | 65 20 72 65 73 6f 75 72 |ccess th|e resour|
|000045a0| 63 65 20 61 6e 64 20 6d | 61 79 20 6e 6f 20 6c 6f |ce and m|ay no lo|
|000045b0| 6e 67 65 72 20 77 6f 72 | 6b 0d 09 70 72 6f 70 65 |nger wor|k..prope|
|000045c0| 72 6c 79 2e 0d 09 0d 54 | 68 65 20 63 68 61 6e 67 |rly....T|he chang|
|000045d0| 65 20 77 69 6c 6c 20 62 | 65 20 77 72 69 74 74 65 |e will b|e writte|
|000045e0| 6e 20 74 6f 20 74 68 65 | 20 72 65 73 6f 75 72 63 |n to the| resourc|
|000045f0| 65 20 66 69 6c 65 20 77 | 68 65 6e 20 74 68 65 20 |e file w|hen the |
|00004600| 66 69 6c 65 20 69 73 0d | 75 70 64 61 74 65 64 20 |file is.|updated |
|00004610| 69 66 20 79 6f 75 20 66 | 6f 6c 6c 6f 77 20 53 65 |if you f|ollow Se|
|00004620| 74 52 65 73 49 6e 66 6f | 20 77 69 74 68 20 61 20 |tResInfo| with a |
|00004630| 63 61 6c 6c 20 74 6f 20 | 43 68 61 6e 67 65 64 52 |call to |ChangedR|
|00004640| 65 73 6f 75 72 63 65 2e | 0d 0d 28 77 61 72 6e 69 |esource.|..(warni|
|00004650| 6e 67 29 0d 09 45 76 65 | 6e 20 69 66 20 79 6f 75 |ng)..Eve|n if you|
|00004660| 20 64 6f 6e 27 74 20 63 | 61 6c 6c 20 43 68 61 6e | don't c|all Chan|
|00004670| 67 65 64 20 52 65 73 6f | 75 72 63 65 20 66 6f 72 |ged Reso|urce for|
|00004680| 20 74 68 69 73 20 72 65 | 73 6f 75 72 63 65 2c 0d | this re|source,.|
|00004690| 09 74 68 65 20 63 68 61 | 6e 67 65 20 6d 61 79 20 |.the cha|nge may |
|000046a0| 62 65 20 77 72 69 74 74 | 65 6e 20 74 6f 20 74 68 |be writt|en to th|
|000046b0| 65 20 72 65 73 6f 75 72 | 63 65 20 66 69 6c 65 20 |e resour|ce file |
|000046c0| 77 68 65 6e 20 74 68 65 | 20 0d 09 66 69 6c 65 20 |when the| ..file |
|000046d0| 69 73 20 75 70 64 61 74 | 65 64 2e 20 20 49 66 20 |is updat|ed. If |
|000046e0| 79 6f 75 27 76 65 20 65 | 76 65 72 20 63 61 6c 6c |you've e|ver call|
|000046f0| 65 64 20 43 68 61 6e 67 | 65 64 52 65 73 6f 75 72 |ed Chang|edResour|
|00004700| 63 65 0d 09 66 6f 72 20 | 61 6e 79 20 72 65 73 6f |ce..for |any reso|
|00004710| 75 72 63 65 20 69 6e 20 | 74 68 65 20 66 69 6c 65 |urce in |the file|
|00004720| 2c 20 6f 72 20 69 66 20 | 79 6f 75 27 76 65 20 61 |, or if |you've a|
|00004730| 64 64 65 64 20 6f 72 20 | 0d 09 72 65 6d 6f 76 65 |dded or |..remove|
|00004740| 64 20 61 20 72 65 73 6f | 75 72 63 65 2c 20 74 68 |d a reso|urce, th|
|00004750| 65 20 52 65 73 6f 75 72 | 63 65 20 4d 61 6e 61 67 |e Resour|ce Manag|
|00004760| 65 72 20 77 69 6c 6c 20 | 77 72 69 74 65 20 6f 75 |er will |write ou|
|00004770| 74 20 0d 09 74 68 65 20 | 65 6e 74 69 72 65 20 72 |t ..the |entire r|
|00004780| 65 73 6f 75 72 63 65 20 | 6d 61 70 20 77 68 65 6e |esource |map when|
|00004790| 20 69 74 20 75 70 64 61 | 74 65 73 20 74 68 65 20 | it upda|tes the |
|000047a0| 66 69 6c 65 2c 20 73 6f | 20 61 6c 6c 20 0d 09 63 |file, so| all ..c|
|000047b0| 68 61 6e 67 65 73 20 6d | 61 64 65 20 74 6f 20 72 |hanges m|ade to r|
|000047c0| 65 73 6f 75 72 63 65 20 | 69 6e 66 6f 72 6d 61 74 |esource |informat|
|000047d0| 69 6f 6e 20 69 6e 20 74 | 68 65 20 6d 61 70 20 77 |ion in t|he map w|
|000047e0| 69 6c 6c 20 0d 09 62 65 | 63 6f 6d 65 20 70 65 72 |ill ..be|come per|
|000047f0| 6d 61 6e 65 6e 74 2e 20 | 20 49 66 20 79 6f 75 20 |manent. | If you |
|00004800| 77 61 6e 74 20 61 6e 79 | 20 6f 66 20 74 68 65 20 |want any| of the |
|00004810| 63 68 61 6e 67 65 73 20 | 74 6f 20 62 65 20 0d 09 |changes |to be ..|
|00004820| 74 65 6d 70 72 61 72 79 | 2c 20 79 6f 75 27 6c 6c |temprary|, you'll|
|00004830| 20 68 61 76 65 20 74 6f | 20 72 65 73 74 6f 72 65 | have to| restore|
|00004840| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 0d 09 | the ori|ginal ..|
|00004850| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 62 65 66 6f |informat|ion befo|
|00004860| 72 65 20 74 68 65 20 66 | 69 6c 65 20 69 73 20 75 |re the f|ile is u|
|00004870| 70 64 61 74 65 64 2e 0d | 09 0d 53 65 74 52 65 73 |pdated..|..SetRes|
|00004880| 49 6e 66 6f 20 64 6f 65 | 73 20 6e 6f 74 68 69 6e |Info doe|s nothin|
|00004890| 67 20 69 6e 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |g in the| followi|
|000048a0| 6e 67 20 63 61 73 65 73 | 3a 0d 0d 09 2d 20 54 68 |ng cases|:...- Th|
|000048b0| 65 20 72 65 73 50 72 6f | 74 65 63 74 65 64 20 61 |e resPro|tected a|
|000048c0| 74 74 72 69 62 75 74 65 | 20 66 6f 72 20 74 68 65 |ttribute| for the|
|000048d0| 20 72 65 73 6f 75 72 63 | 65 20 69 73 20 73 65 74 | resourc|e is set|
|000048e0| 2e 0d 09 0d 09 2d 20 54 | 68 65 20 67 69 76 65 6e |.....- T|he given|
|000048f0| 20 68 61 6e 64 6c 65 20 | 69 73 6e 27 74 20 61 20 | handle |isn't a |
|00004900| 68 61 6e 64 6c 65 20 74 | 6f 20 61 20 72 65 73 6f |handle t|o a reso|
|00004910| 75 72 63 65 2e 20 20 54 | 68 65 20 52 65 73 45 72 |urce. T|he ResEr|
|00004920| 72 6f 72 0d 09 20 20 66 | 75 6e 63 74 69 6f 6e 20 |ror.. f|unction |
|00004930| 77 69 6c 6c 20 72 65 74 | 75 72 6e 20 74 68 65 20 |will ret|urn the |
|00004940| 72 65 73 75 6c 74 20 63 | 6f 64 65 20 72 65 73 4e |result c|ode resN|
|00004950| 6f 74 46 6f 75 6e 64 2e | 0d 09 20 20 0d 09 2d 20 |otFound.|.. ..- |
|00004960| 54 68 65 20 72 65 73 6f | 75 72 63 65 20 6d 61 70 |The reso|urce map|
|00004970| 20 62 65 63 6f 6d 65 73 | 20 74 6f 6f 20 6c 61 72 | becomes| too lar|
|00004980| 67 65 20 74 6f 20 66 69 | 74 20 69 6e 20 6d 65 6d |ge to fi|t in mem|
|00004990| 6f 72 79 20 28 77 68 69 | 63 68 20 63 61 6e 0d 09 |ory (whi|ch can..|
|000049a0| 20 20 68 61 70 70 65 6e | 20 69 66 20 61 20 6e 61 | happen| if a na|
|000049b0| 6d 65 20 69 73 20 70 61 | 73 73 65 64 29 20 6f 72 |me is pa|ssed) or|
|000049c0| 20 73 75 66 66 69 63 69 | 65 6e 74 20 73 70 61 63 | suffici|ent spac|
|000049d0| 65 20 66 6f 72 20 74 68 | 65 20 6d 6f 64 69 66 69 |e for th|e modifi|
|000049e0| 65 64 20 0d 09 20 20 72 | 65 73 6f 75 72 63 65 20 |ed .. r|esource |
|000049f0| 66 69 6c 65 20 63 61 6e | 27 74 20 62 65 20 72 65 |file can|'t be re|
|00004a00| 73 65 72 76 65 64 20 6f | 6e 20 74 68 65 20 64 69 |served o|n the di|
|00004a10| 73 6b 2e 20 20 52 65 73 | 45 72 72 6f 72 20 77 69 |sk. Res|Error wi|
|00004a20| 6c 6c 20 72 65 74 75 72 | 6e 20 0d 09 20 20 61 6e |ll retur|n .. an|
|00004a30| 20 61 70 70 72 6f 70 72 | 69 61 74 65 20 4f 70 65 | appropr|iate Ope|
|00004a40| 72 61 74 69 6e 67 20 53 | 79 73 74 65 6d 20 72 65 |rating S|ystem re|
|00004a50| 73 75 6c 74 20 63 6f 64 | 65 2e 20 0d 09 20 20 0d |sult cod|e. .. .|
|00004a60| 0d 5c 20 53 65 74 52 65 | 73 41 74 74 72 73 0d 31 |.\ SetRe|sAttrs.1|
|00004a70| 0d 50 52 4f 43 45 44 55 | 52 45 20 53 65 74 52 65 |.PROCEDU|RE SetRe|
|00004a80| 73 41 74 74 72 73 20 28 | 74 68 65 52 65 73 6f 75 |sAttrs (|theResou|
|00004a90| 72 63 65 3a 20 48 61 6e | 64 6c 65 3b 20 61 74 74 |rce: Han|dle; att|
|00004aa0| 72 73 3a 20 49 4e 54 45 | 47 45 52 29 3b 0d 0d 47 |rs: INTE|GER);..G|
|00004ab0| 69 76 65 6e 20 61 20 68 | 61 6e 64 6c 65 20 74 6f |iven a h|andle to|
|00004ac0| 20 61 20 72 65 73 6f 75 | 72 63 65 2c 20 53 65 74 | a resou|rce, Set|
|00004ad0| 52 65 73 41 74 74 72 73 | 20 73 65 74 73 20 74 68 |ResAttrs| sets th|
|00004ae0| 65 20 72 65 73 6f 75 72 | 63 65 20 61 74 74 72 69 |e resour|ce attri|
|00004af0| 62 75 74 65 73 0d 66 6f | 72 20 74 68 65 20 72 65 |butes.fo|r the re|
|00004b00| 73 6f 75 72 63 65 20 74 | 6f 20 61 74 74 72 73 2e |source t|o attrs.|
|00004b10| 20 20 28 52 65 73 6f 75 | 72 63 65 20 61 74 74 72 | (Resou|rce attr|
|00004b20| 69 62 75 74 65 73 20 61 | 72 65 20 64 65 73 63 72 |ibutes a|re descr|
|00004b30| 69 62 65 64 20 61 62 6f | 76 65 0d 75 6e 64 65 72 |ibed abo|ve.under|
|00004b40| 20 22 52 65 73 6f 75 72 | 63 65 20 52 65 66 65 72 | "Resour|ce Refer|
|00004b50| 65 72 65 6e 63 65 22 2e | 29 20 20 54 68 65 20 72 |erence".|) The r|
|00004b60| 65 73 50 72 6f 74 65 63 | 74 65 64 20 61 74 74 72 |esProtec|ted attr|
|00004b70| 69 62 75 74 65 20 74 61 | 6b 65 73 20 65 66 66 65 |ibute ta|kes effe|
|00004b80| 63 74 0d 69 6d 6d 65 64 | 69 61 74 65 6c 79 3b 20 |ct.immed|iately; |
|00004b90| 74 68 65 20 6f 74 68 65 | 72 73 20 74 61 6b 65 20 |the othe|rs take |
|00004ba0| 65 66 66 65 63 74 20 74 | 68 65 20 6e 65 78 74 20 |effect t|he next |
|00004bb0| 74 69 6d 65 20 74 68 65 | 20 72 65 73 6f 75 72 63 |time the| resourc|
|00004bc0| 65 20 69 73 20 72 65 61 | 64 20 0d 69 6e 2e 0d 0d |e is rea|d .in...|
|00004bd0| 28 77 61 72 6e 69 6e 67 | 29 0d 09 44 6f 20 6e 6f |(warning|)..Do no|
|00004be0| 74 20 75 73 65 20 53 65 | 74 52 65 73 41 74 74 72 |t use Se|tResAttr|
|00004bf0| 73 20 74 6f 20 73 65 74 | 20 74 68 65 20 72 65 73 |s to set| the res|
|00004c00| 43 68 61 6e 67 65 64 20 | 61 74 74 72 69 62 75 74 |Changed |attribut|
|00004c10| 65 3b 0d 09 79 6f 75 20 | 6d 75 73 74 20 63 61 6c |e;..you |must cal|
|00004c20| 6c 20 43 68 61 6e 67 65 | 64 20 52 65 73 6f 75 72 |l Change|d Resour|
|00004c30| 63 65 20 69 6e 73 74 65 | 61 64 2e 20 20 42 65 20 |ce inste|ad. Be |
|00004c40| 73 75 72 65 20 74 68 61 | 74 20 74 68 65 20 0d 09 |sure tha|t the ..|
|00004c50| 61 74 74 72 73 20 70 61 | 72 61 6d 65 74 65 72 20 |attrs pa|rameter |
|00004c60| 70 61 73 73 65 64 20 74 | 6f 20 53 65 74 52 65 73 |passed t|o SetRes|
|00004c70| 41 74 74 72 73 20 64 6f | 65 73 6e 27 74 20 63 68 |Attrs do|esn't ch|
|00004c80| 61 6e 67 65 20 74 68 65 | 20 0d 09 63 75 72 72 65 |ange the| ..curre|
|00004c90| 6e 74 20 73 65 74 74 69 | 6e 67 20 6f 66 20 74 68 |nt setti|ng of th|
|00004ca0| 69 73 20 61 74 74 72 69 | 62 75 74 65 2e 0d 09 0d |is attri|bute....|
|00004cb0| 54 68 65 20 61 74 74 72 | 69 62 75 74 65 73 20 73 |The attr|ibutes s|
|00004cc0| 65 74 20 77 69 74 68 20 | 53 65 74 52 65 73 41 74 |et with |SetResAt|
|00004cd0| 74 72 73 20 77 69 6c 6c | 20 62 65 20 77 72 69 74 |trs will| be writ|
|00004ce0| 74 65 6e 20 74 6f 20 74 | 68 65 20 72 65 73 6f 75 |ten to t|he resou|
|00004cf0| 72 63 65 0d 66 69 6c 65 | 20 77 68 65 6e 20 74 68 |rce.file| when th|
|00004d00| 65 20 66 69 6c 65 20 69 | 73 20 75 70 64 61 74 65 |e file i|s update|
|00004d10| 64 20 69 66 20 79 6f 75 | 20 66 6f 6c 6c 6f 77 20 |d if you| follow |
|00004d20| 53 65 74 52 65 73 41 74 | 74 72 73 20 77 69 74 68 |SetResAt|trs with|
|00004d30| 20 61 20 63 61 6c 6c 20 | 74 6f 20 0d 43 68 61 6e | a call |to .Chan|
|00004d40| 67 65 64 52 65 73 6f 75 | 72 63 65 2e 20 20 48 6f |gedResou|rce. Ho|
|00004d50| 77 65 76 65 72 2c 20 65 | 76 65 6e 20 69 66 20 79 |wever, e|ven if y|
|00004d60| 6f 75 20 64 6f 6e 27 74 | 20 63 61 6c 6c 20 43 68 |ou don't| call Ch|
|00004d70| 61 6e 67 65 64 52 65 73 | 6f 75 72 63 65 20 66 6f |angedRes|ource fo|
|00004d80| 72 0d 74 68 69 73 20 72 | 65 73 6f 75 72 63 65 2c |r.this r|esource,|
|00004d90| 20 74 68 65 20 63 68 61 | 6e 67 65 20 6d 61 79 20 | the cha|nge may |
|00004da0| 62 65 20 77 72 69 74 74 | 65 6e 20 74 6f 20 74 68 |be writt|en to th|
|00004db0| 65 20 72 65 73 6f 75 72 | 63 65 20 66 69 6c 65 20 |e resour|ce file |
|00004dc0| 77 68 65 6e 20 74 68 65 | 20 0d 66 69 6c 65 20 69 |when the| .file i|
|00004dd0| 73 20 75 70 64 61 74 65 | 64 2e 20 20 53 65 65 20 |s update|d. See |
|00004de0| 74 68 65 20 6c 61 73 74 | 20 77 61 72 6e 69 6e 67 |the last| warning|
|00004df0| 20 66 6f 72 20 53 65 74 | 52 65 73 49 6e 66 6f 20 | for Set|ResInfo |
|00004e00| 28 61 62 6f 76 65 29 2e | 0d 0d 49 66 20 74 68 65 |(above).|..If the|
|00004e10| 20 67 69 76 65 6e 20 68 | 61 6e 64 6c 65 20 69 73 | given h|andle is|
|00004e20| 6e 27 74 20 61 20 68 61 | 6e 64 6c 65 20 74 6f 20 |n't a ha|ndle to |
|00004e30| 61 20 72 65 73 6f 75 72 | 63 65 2c 20 53 65 74 52 |a resour|ce, SetR|
|00004e40| 65 73 41 74 74 72 73 20 | 77 69 6c 6c 20 64 6f 0d |esAttrs |will do.|
|00004e50| 6e 6f 74 68 69 6e 67 20 | 61 6e 64 20 74 68 65 20 |nothing |and the |
|00004e60| 52 65 73 45 72 72 6f 72 | 20 66 75 6e 63 74 69 6f |ResError| functio|
|00004e70| 6e 20 77 69 6c 6c 20 72 | 65 74 75 72 6e 20 74 68 |n will r|eturn th|
|00004e80| 65 20 72 65 73 75 6c 74 | 20 63 6f 64 65 0d 72 65 |e result| code.re|
|00004e90| 73 4e 6f 74 46 6f 75 6e | 64 2e 0d 0d 0d 5c 20 43 |sNotFoun|d....\ C|
|00004ea0| 68 61 6e 67 65 64 52 65 | 73 6f 75 72 63 65 0d 31 |hangedRe|source.1|
|00004eb0| 0d 50 52 4f 43 45 44 55 | 52 45 20 43 68 61 6e 67 |.PROCEDU|RE Chang|
|00004ec0| 65 64 52 65 73 6f 75 72 | 63 65 20 28 74 68 65 52 |edResour|ce (theR|
|00004ed0| 65 73 6f 75 72 63 65 3a | 20 48 61 6e 64 6c 65 29 |esource:| Handle)|
|00004ee0| 3b 0d 0d 43 61 6c 6c 20 | 43 68 61 6e 67 65 64 52 |;..Call |ChangedR|
|00004ef0| 65 73 6f 75 72 63 65 20 | 61 66 74 65 72 20 63 68 |esource |after ch|
|00004f00| 61 6e 67 69 6e 67 20 65 | 69 74 68 65 72 20 74 68 |anging e|ither th|
|00004f10| 65 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 61 62 |e inform|ation ab|
|00004f20| 6f 75 74 20 61 0d 72 65 | 73 6f 75 72 63 65 20 69 |out a.re|source i|
|00004f30| 6e 20 74 68 65 20 72 65 | 73 6f 75 72 63 65 20 6d |n the re|source m|
|00004f40| 61 70 20 28 61 73 20 64 | 65 73 63 72 69 62 65 64 |ap (as d|escribed|
|00004f50| 20 61 62 6f 76 65 20 75 | 6e 64 65 72 20 53 65 74 | above u|nder Set|
|00004f60| 52 65 73 49 6e 66 6f 20 | 61 6e 64 20 0d 53 65 74 |ResInfo |and .Set|
|00004f70| 52 65 73 41 74 74 72 73 | 29 20 6f 72 20 74 68 65 |ResAttrs|) or the|
|00004f80| 20 72 65 73 6f 75 72 63 | 65 20 64 61 74 61 20 66 | resourc|e data f|
|00004f90| 6f 72 20 61 20 72 65 73 | 6f 75 72 63 65 2c 20 69 |or a res|ource, i|
|00004fa0| 66 20 79 6f 75 20 77 61 | 6e 74 20 74 68 65 20 0d |f you wa|nt the .|
|00004fb0| 63 68 61 6e 67 65 20 74 | 6f 20 62 65 20 70 65 72 |change t|o be per|
|00004fc0| 6d 61 6e 65 6e 74 2e 20 | 20 47 69 76 65 6e 20 61 |manent. | Given a|
|00004fd0| 20 68 61 6e 64 6c 65 20 | 74 6f 20 61 20 72 65 73 | handle |to a res|
|00004fe0| 6f 75 72 63 65 2c 20 43 | 68 61 6e 67 65 64 52 65 |ource, C|hangedRe|
|00004ff0| 73 6f 75 72 63 65 0d 73 | 65 74 73 20 74 68 65 20 |source.s|ets the |
|00005000| 72 65 73 43 68 61 6e 67 | 65 64 20 61 74 74 72 69 |resChang|ed attri|
|00005010| 62 75 74 65 20 66 6f 72 | 20 74 68 65 20 72 65 73 |bute for| the res|
|00005020| 6f 75 72 63 65 2e 20 20 | 54 68 69 73 20 61 74 74 |ource. |This att|
|00005030| 72 69 62 75 74 65 20 74 | 65 6c 6c 73 0d 74 68 65 |ribute t|ells.the|
|00005040| 20 52 65 73 6f 75 72 63 | 65 20 4d 61 6e 61 67 65 | Resourc|e Manage|
|00005050| 72 20 74 6f 20 64 6f 20 | 62 6f 74 68 20 6f 66 20 |r to do |both of |
|00005060| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 3a 0d 0d |the foll|owing:..|
|00005070| 09 2d 20 77 72 69 74 65 | 20 74 68 65 20 72 65 73 |.- write| the res|
|00005080| 6f 75 72 63 65 20 64 61 | 74 61 20 66 6f 72 20 74 |ource da|ta for t|
|00005090| 68 65 20 72 65 73 6f 75 | 72 63 65 20 74 6f 20 74 |he resou|rce to t|
|000050a0| 68 65 20 72 65 73 6f 75 | 72 63 65 20 66 69 6c 65 |he resou|rce file|
|000050b0| 20 77 68 65 6e 20 0d 09 | 20 20 74 68 65 20 66 69 | when ..| the fi|
|000050c0| 6c 65 20 69 73 20 75 70 | 64 61 74 65 64 20 6f 72 |le is up|dated or|
|000050d0| 20 77 68 65 6e 20 57 72 | 69 74 65 52 65 73 6f 75 | when Wr|iteResou|
|000050e0| 72 63 65 20 69 73 20 63 | 61 6c 6c 65 64 0d 09 0d |rce is c|alled...|
|000050f0| 09 2d 20 77 72 69 74 65 | 20 74 68 65 20 65 6e 74 |.- write| the ent|
|00005100| 69 72 65 20 72 65 73 6f | 75 72 63 65 20 6d 61 70 |ire reso|urce map|
|00005110| 20 74 6f 20 74 68 65 20 | 72 65 73 6f 75 72 63 65 | to the |resource|
|00005120| 20 66 69 6c 65 20 77 68 | 65 6e 20 74 68 65 20 66 | file wh|en the f|
|00005130| 69 6c 65 20 0d 09 20 20 | 69 73 20 75 70 64 61 74 |ile .. |is updat|
|00005140| 65 64 2e 0d 09 20 20 0d | 28 77 61 72 6e 69 6e 67 |ed... .|(warning|
|00005150| 29 0d 09 49 66 20 79 6f | 75 20 63 68 61 6e 67 65 |)..If yo|u change|
|00005160| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 69 6e 20 | informa|tion in |
|00005170| 74 68 65 20 72 65 73 6f | 75 72 63 65 20 6d 61 70 |the reso|urce map|
|00005180| 20 77 69 74 68 20 0d 09 | 53 65 74 52 65 73 e9 6e | with ..|SetRes.n|
|00005190| 66 6f 20 6f 72 20 53 65 | 74 52 65 73 41 74 74 72 |fo or Se|tResAttr|
|000051a0| 73 20 61 6e 64 20 74 68 | 65 6e 20 63 61 6c 6c 20 |s and th|en call |
|000051b0| 43 68 61 6e 67 65 64 52 | 65 73 6f 75 72 63 65 2c |ChangedR|esource,|
|000051c0| 20 0d 09 72 65 6d 65 6d | 62 65 72 20 74 68 61 74 | ..remem|ber that|
|000051d0| 20 6e 6f 74 20 6f 6e 6c | 79 20 74 68 65 20 72 65 | not onl|y the re|
|000051e0| 73 6f 75 72 63 65 20 6d | 61 70 20 62 75 74 20 61 |source m|ap but a|
|000051f0| 6c 73 6f 20 74 68 65 20 | 0d 09 72 65 73 6f 75 72 |lso the |..resour|
|00005200| 63 65 20 64 61 74 61 20 | 77 69 6c 6c 20 62 65 20 |ce data |will be |
|00005210| 77 72 69 74 74 65 6e 20 | 6f 75 74 20 77 68 65 6e |written |out when|
|00005220| 20 74 68 65 20 72 65 73 | 6f 75 72 63 65 20 66 69 | the res|ource fi|
|00005230| 6c 65 20 0d 09 69 73 20 | 75 70 64 61 74 65 64 2e |le ..is |updated.|
|00005240| 0d 09 0d 54 6f 20 63 68 | 61 6e 67 65 20 74 68 65 |...To ch|ange the|
|00005250| 20 72 65 73 6f 75 72 63 | 65 20 64 61 74 61 20 66 | resourc|e data f|
|00005260| 6f 72 20 61 20 70 75 72 | 67 65 61 62 6c 65 20 72 |or a pur|geable r|
|00005270| 65 73 6f 75 72 63 65 20 | 61 6e 64 20 6d 61 6b 65 |esource |and make|
|00005280| 20 74 68 65 20 0d 63 68 | 61 6e 67 65 20 70 65 72 | the .ch|ange per|
|00005290| 6d 61 6e 65 6e 74 2c 20 | 79 6f 75 20 68 61 76 65 |manent, |you have|
|000052a0| 20 74 6f 20 74 61 6b 65 | 20 73 70 65 63 69 61 6c | to take| special|
|000052b0| 20 70 72 65 63 61 75 74 | 69 6f 6e 73 20 74 6f 20 | precaut|ions to |
|000052c0| 65 6e 73 75 72 65 20 74 | 68 61 74 0d 74 68 65 20 |ensure t|hat.the |
|000052d0| 72 65 73 6f 75 72 63 65 | 20 77 6f 6e 27 74 20 62 |resource| won't b|
|000052e0| 65 20 70 75 72 67 65 64 | 20 77 68 69 6c 65 20 79 |e purged| while y|
|000052f0| 6f 75 27 72 65 20 63 68 | 61 6e 67 69 6e 67 20 69 |ou're ch|anging i|
|00005300| 74 2e 20 20 59 6f 75 20 | 63 61 6e 20 6d 61 6b 65 |t. You |can make|
|00005310| 20 0d 74 68 65 20 72 65 | 73 6f 75 72 63 65 20 74 | .the re|source t|
|00005320| 65 6d 70 6f 72 61 72 69 | 6c 79 20 75 6e 70 75 72 |emporari|ly unpur|
|00005330| 67 65 61 62 6c 65 20 61 | 6e 64 20 74 68 65 6e 20 |geable a|nd then |
|00005340| 77 72 69 74 65 20 69 74 | 20 6f 75 74 20 77 69 74 |write it| out wit|
|00005350| 68 20 0d 57 72 69 74 65 | 52 65 73 6f 75 72 63 65 |h .Write|Resource|
|00005360| 20 62 65 66 6f 72 65 20 | 6d 61 6b 69 6e 67 20 69 | before |making i|
|00005370| 74 20 70 75 72 67 65 61 | 62 6c 65 20 61 67 61 69 |t purgea|ble agai|
|00005380| 6e 2e 20 20 59 6f 75 20 | 68 61 76 65 20 74 6f 20 |n. You |have to |
|00005390| 75 73 65 20 74 68 65 20 | 0d 4d 65 6d 6f 72 79 20 |use the |.Memory |
|000053a0| 4d 61 6e 61 67 65 72 20 | 70 72 6f 63 65 64 75 72 |Manager |procedur|
|000053b0| 65 73 20 20 48 4e 6f 50 | 75 72 67 65 20 61 6e 64 |es HNoP|urge and|
|000053c0| 20 48 50 75 72 67 65 20 | 74 6f 20 6d 61 6b 65 20 | HPurge |to make |
|000053d0| 74 68 65 20 72 65 73 6f | 75 72 63 65 0d 75 6e 70 |the reso|urce.unp|
|000053e0| 75 72 67 65 61 62 6c 65 | 20 61 6e 64 20 70 75 72 |urgeable| and pur|
|000053f0| 67 65 61 62 6c 65 3b 20 | 53 65 74 52 65 73 41 74 |geable; |SetResAt|
|00005400| 74 72 73 20 63 61 6e 27 | 74 20 62 65 20 75 73 65 |trs can'|t be use|
|00005410| 64 20 62 65 63 61 75 73 | 65 20 69 74 20 77 6f 6e |d becaus|e it won|
|00005420| 27 74 20 0d 74 61 6b 65 | 20 65 66 66 65 63 74 20 |'t .take| effect |
|00005430| 69 6d 6d 65 64 69 61 74 | 65 6c 79 2e 20 20 46 6f |immediat|ely. Fo|
|00005440| 72 20 65 78 61 6d 70 6c | 65 3a 0d 0d 09 6d 79 48 |r exampl|e:...myH|
|00005450| 6e 64 6c 20 3a 3d 20 47 | 65 74 52 65 73 6f 75 72 |ndl := G|etResour|
|00005460| 63 65 28 74 79 70 65 2c | 49 44 3b 09 7b 6f 72 20 |ce(type,|ID;.{or |
|00005470| 4c 6f 61 64 52 65 73 6f | 75 72 63 65 28 6d 79 48 |LoadReso|urce(myH|
|00005480| 6e 64 6c 29 20 69 66 20 | 20 7d 0d 09 09 09 09 09 |ndl) if | }......|
|00005490| 7b 20 79 6f 75 27 76 65 | 20 67 6f 74 74 65 6e 20 |{ you've| gotten |
|000054a0| 69 74 20 70 72 65 76 69 | 6f 75 73 6c 79 7d 0d 09 |it previ|ously}..|
|000054b0| 48 4e 6f 50 75 72 67 65 | 28 6d 79 48 6e 64 6c 29 |HNoPurge|(myHndl)|
|000054c0| 3b 09 09 7b 6d 61 6b 65 | 20 69 74 20 75 6e 70 75 |;..{make| it unpu|
|000054d0| 72 67 65 61 62 6c 65 7d | 0d 09 20 20 2e 20 20 2e |rgeable}|.. . .|
|000054e0| 03 20 03 20 2e 09 09 09 | 7b 6d 61 6b 65 20 74 68 |. . ....|{make th|
|000054f0| 65 20 63 68 61 6e 67 65 | 73 20 68 65 72 65 7d 0d |e change|s here}.|
|00005500| 09 43 68 61 6e 67 65 64 | 52 65 73 6f 75 72 63 65 |.Changed|Resource|
|00005510| 28 6d 79 48 6e 64 6c 29 | 3b 09 7b 6d 61 72 6b 20 |(myHndl)|;.{mark |
|00005520| 69 74 20 63 68 61 6e 67 | 65 64 7d 0d 20 20 20 20 |it chang|ed}. |
|00005530| 20 20 20 09 57 72 69 74 | 65 52 65 73 6f 75 72 63 | .Writ|eResourc|
|00005540| 65 28 6d 79 48 6e 64 6c | 29 3b 09 09 7b 77 72 69 |e(myHndl|);..{wri|
|00005550| 74 65 20 69 74 20 6f 75 | 74 7d 0d 09 48 50 75 72 |te it ou|t}..HPur|
|00005560| 67 65 28 6d 79 48 6e 64 | 6c 29 09 09 09 7b 6d 61 |ge(myHnd|l)...{ma|
|00005570| 6b 65 20 69 74 20 70 75 | 72 67 65 61 62 6c 65 20 |ke it pu|rgeable |
|00005580| 61 67 61 69 6e 7d 0d 0d | 4f 72 2c 20 69 6e 73 74 |again}..|Or, inst|
|00005590| 65 61 64 20 6f 66 20 63 | 61 6c 6c 69 6e 67 20 57 |ead of c|alling W|
|000055a0| 72 69 74 65 52 65 73 6f | 75 72 63 65 20 74 6f 20 |riteReso|urce to |
|000055b0| 77 72 69 74 65 20 74 68 | 65 20 64 61 74 61 20 6f |write th|e data o|
|000055c0| 75 74 20 69 6d 6d 65 64 | 69 61 74 65 6c 79 2c 20 |ut immed|iately, |
|000055d0| 0d 79 6f 75 20 63 61 6e | 20 63 61 6c 6c 20 53 65 |.you can| call Se|
|000055e0| 74 52 65 73 50 75 72 67 | 65 28 54 52 55 45 29 20 |tResPurg|e(TRUE) |
|000055f0| 62 65 66 6f 72 65 20 6d | 61 6b 69 6e 67 20 61 6e |before m|aking an|
|00005600| 79 20 63 68 61 6e 67 65 | 73 20 74 6f 20 70 75 72 |y change|s to pur|
|00005610| 67 65 61 62 6c 65 0d 72 | 65 73 6f 75 72 63 65 20 |geable.r|esource |
|00005620| 64 61 74 61 2e 0d 0d 43 | 68 61 6e 67 65 64 52 65 |data...C|hangedRe|
|00005630| 73 6f 75 72 63 65 20 64 | 6f 65 73 20 6e 6f 74 68 |source d|oes noth|
|00005640| 69 6e 67 20 69 6e 20 74 | 68 65 20 66 6f 6c 6c 6f |ing in t|he follo|
|00005650| 77 69 6e 67 20 63 61 73 | 65 73 3a 0d 0d 09 2d 20 |wing cas|es:...- |
|00005660| 54 68 65 20 67 69 76 65 | 6e 20 68 61 6e 64 6c 65 |The give|n handle|
|00005670| 20 69 73 6e 27 74 20 61 | 20 68 61 6e 64 6c 65 20 | isn't a| handle |
|00005680| 74 6f 20 61 20 72 65 73 | 6f 75 72 63 65 2e 20 20 |to a res|ource. |
|00005690| 54 68 65 20 52 65 73 45 | 72 72 6f 72 0d 09 20 20 |The ResE|rror.. |
|000056a0| 66 75 6e 63 74 69 6f 6e | 20 77 69 6c 6c 20 72 65 |function| will re|
|000056b0| 74 75 72 6e 20 74 68 65 | 20 72 65 73 75 6c 74 20 |turn the| result |
|000056c0| 63 6f 64 65 20 72 65 73 | 4e 6f 74 46 6f 75 6e 64 |code res|NotFound|
|000056d0| 2e 20 0d 09 20 20 0d 09 | 2d 20 53 75 66 66 69 63 |. .. ..|- Suffic|
|000056e0| 69 65 6e 74 20 73 70 61 | 63 65 20 66 6f 72 20 74 |ient spa|ce for t|
|000056f0| 68 65 20 6d 6f 64 69 66 | 69 65 64 20 72 65 73 6f |he modif|ied reso|
|00005700| 75 72 63 65 20 66 69 6c | 65 20 63 61 6e 27 74 20 |urce fil|e can't |
|00005710| 62 65 20 72 65 73 65 72 | 76 65 64 0d 09 20 20 6f |be reser|ved.. o|
|00005720| 6e 20 74 68 65 20 64 69 | 73 6b 2e 20 20 52 65 73 |n the di|sk. Res|
|00005730| 45 72 72 6f 72 20 77 69 | 6c 6c 20 72 65 74 75 72 |Error wi|ll retur|
|00005740| 6e 20 61 6e 20 61 70 70 | 72 6f 70 72 69 61 74 65 |n an app|ropriate|
|00005750| 20 4f 70 65 72 61 74 69 | 6e 67 20 53 79 73 74 65 | Operati|ng Syste|
|00005760| 6d 0d 09 20 20 72 65 73 | 75 6c 74 20 63 6f 64 65 |m.. res|ult code|
|00005770| 2e 0d 09 20 20 0d 28 77 | 61 72 6e 69 6e 67 29 0d |... .(w|arning).|
|00005780| 09 42 65 20 61 77 61 72 | 65 20 74 68 61 74 20 43 |.Be awar|e that C|
|00005790| 68 61 6e 67 65 64 52 65 | 73 6f 75 72 63 65 20 28 |hangedRe|source (|
|000057a0| 61 6e 64 20 6e 6f 74 20 | 57 72 69 74 65 52 65 73 |and not |WriteRes|
|000057b0| 6f 75 72 63 65 29 0d 09 | 63 68 65 63 6b 73 20 74 |ource)..|checks t|
|000057c0| 6f 20 73 65 65 20 69 66 | 20 74 68 65 72 65 27 73 |o see if| there's|
|000057d0| 20 73 75 66 66 69 63 69 | 65 6e 74 20 64 69 73 6b | suffici|ent disk|
|000057e0| 20 73 70 61 63 65 20 74 | 6f 20 77 72 69 74 65 0d | space t|o write.|
|000057f0| 09 6f 75 74 20 74 68 65 | 20 6d 6f 64 69 66 69 65 |.out the| modifie|
|00005800| 64 20 66 69 6c 65 3b 20 | 69 74 20 74 68 65 72 65 |d file; |it there|
|00005810| 20 69 73 6e 27 74 20 65 | 6e 6f 75 67 68 20 73 70 | isn't e|nough sp|
|00005820| 61 63 65 2c 20 74 68 65 | 20 0d 09 72 65 73 43 68 |ace, the| ..resCh|
|00005830| 61 6e 67 65 64 20 61 74 | 74 72 69 62 75 74 65 20 |anged at|tribute |
|00005840| 77 6f 6e 27 74 20 62 65 | 20 73 65 74 2e 20 20 54 |won't be| set. T|
|00005850| 68 69 73 20 6d 65 61 6e | 73 20 74 68 61 74 20 77 |his mean|s that w|
|00005860| 68 65 6e 20 0d 09 57 72 | 69 74 65 20 52 65 73 6f |hen ..Wr|ite Reso|
|00005870| 75 72 63 65 20 69 73 20 | 63 61 6c 6c 65 64 2c 69 |urce is |called,i|
|00005880| 74 20 77 6f 6e 27 74 20 | 6b 6e 6f 77 20 74 68 61 |t won't |know tha|
|00005890| 74 20 74 68 65 20 72 65 | 73 6f 75 72 63 65 0d 09 |t the re|source..|
|000058a0| 66 69 6c 65 20 68 61 73 | 20 62 65 65 6e 20 63 68 |file has| been ch|
|000058b0| 61 6e 67 65 64 3b 20 69 | 74 20 77 6f 6e 27 74 20 |anged; i|t won't |
|000058c0| 77 72 69 74 65 20 6f 75 | 74 20 74 68 65 20 6d 6f |write ou|t the mo|
|000058d0| 64 69 66 69 65 64 0d 09 | 66 69 6c 65 20 61 6e 64 |dified..|file and|
|000058e0| 20 6e 6f 20 65 72 72 6f | 72 20 77 69 6c 6c 20 62 | no erro|r will b|
|000058f0| 65 20 72 65 74 75 72 6e | 65 64 2e 20 20 46 6f 72 |e return|ed. For|
|00005900| 20 74 68 69 73 20 72 65 | 61 73 6f 6e 2c 0d 09 61 | this re|ason,..a|
|00005910| 6c 77 61 79 73 20 63 68 | 65 63 6b 20 74 6f 20 73 |lways ch|eck to s|
|00005920| 65 65 20 74 68 61 74 20 | 43 68 61 6e 67 65 64 52 |ee that |ChangedR|
|00005930| 65 73 6f 75 72 63 65 20 | 72 65 74 75 72 6e 73 20 |esource |returns |
|00005940| 6e 6f 45 72 72 2e 0d 0d | 0d 5c 20 41 64 64 52 65 |noErr...|.\ AddRe|
|00005950| 73 6f 75 72 63 65 0d 31 | 0d 50 52 4f 43 45 44 55 |source.1|.PROCEDU|
|00005960| 52 45 20 41 64 64 52 65 | 73 6f 75 72 63 65 20 28 |RE AddRe|source (|
|00005970| 74 68 65 44 61 74 61 3a | 20 48 61 6e 64 6c 65 3b |theData:| Handle;|
|00005980| 20 74 68 65 54 79 70 65 | 3a 20 52 65 73 54 79 70 | theType|: ResTyp|
|00005990| 65 3b 20 74 68 65 49 44 | 3a 0d 09 09 49 4e 54 45 |e; theID|:...INTE|
|000059a0| 47 45 52 3b 20 6e 61 6d | 65 3a 20 53 74 72 32 35 |GER; nam|e: Str25|
|000059b0| 35 29 3b 0d 09 09 0d 47 | 69 76 65 6e 20 61 20 68 |5);....G|iven a h|
|000059c0| 61 6e 64 6c 65 20 74 6f | 20 64 61 74 61 20 69 6e |andle to| data in|
|000059d0| 20 6d 65 6d 6f 72 79 20 | 28 6e 6f 74 20 61 20 68 | memory |(not a h|
|000059e0| 61 6e 64 6c 65 20 74 6f | 20 61 6e 20 65 78 69 73 |andle to| an exis|
|000059f0| 74 69 6e 67 0d 72 65 73 | 6f 75 72 63 65 29 2c 20 |ting.res|ource), |
|00005a00| 41 64 64 52 65 73 6f 75 | 72 63 65 20 61 64 64 73 |AddResou|rce adds|
|00005a10| 20 74 6f 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | to the |current |
|00005a20| 72 65 73 6f 75 72 63 65 | 20 66 69 6c 65 20 61 20 |resource| file a |
|00005a30| 72 65 73 6f 75 72 63 65 | 0d 72 65 66 65 72 65 6e |resource|.referen|
|00005a40| 63 65 20 74 68 61 74 20 | 70 6f 69 6e 74 73 20 74 |ce that |points t|
|00005a50| 6f 20 74 68 65 20 64 61 | 74 61 2e 20 20 49 74 20 |o the da|ta. It |
|00005a60| 73 65 74 73 20 74 68 65 | 20 72 65 73 43 68 61 6e |sets the| resChan|
|00005a70| 67 65 64 20 61 74 74 72 | 69 62 75 74 65 0d 66 6f |ged attr|ibute.fo|
|00005a80| 72 20 74 68 65 20 72 65 | 73 6f 75 72 63 65 2c 20 |r the re|source, |
|00005a90| 73 6f 20 74 68 65 20 64 | 61 74 61 20 77 69 6c 6c |so the d|ata will|
|00005aa0| 20 62 65 20 77 72 69 74 | 74 65 6e 20 74 6f 20 74 | be writ|ten to t|
|00005ab0| 68 65 20 72 65 73 6f 75 | 72 63 65 20 66 69 6c 65 |he resou|rce file|
|00005ac0| 20 77 68 65 6e 20 0d 74 | 68 65 20 66 69 6c 65 20 | when .t|he file |
|00005ad0| 69 73 20 75 70 64 61 74 | 65 64 20 6f 72 20 77 68 |is updat|ed or wh|
|00005ae0| 65 6e 20 57 72 69 74 65 | 52 65 73 6f 75 72 63 65 |en Write|Resource|
|00005af0| 20 69 73 20 63 61 6c 6c | 65 64 2e 20 20 49 66 20 | is call|ed. If |
|00005b00| 74 68 65 20 67 69 76 65 | 6e 20 0d 68 61 6e 64 6c |the give|n .handl|
|00005b10| 65 20 69 73 20 65 6d 70 | 74 79 2c 20 7a 65 72 6f |e is emp|ty, zero|
|00005b20| 2d 6c 65 6e 67 74 68 20 | 72 65 73 6f 75 72 63 65 |-length |resource|
|00005b30| 20 64 61 74 61 20 77 69 | 6c 6c 20 62 65 20 77 72 | data wi|ll be wr|
|00005b40| 69 74 74 65 6e 2e 0d 41 | 64 64 52 65 73 6f 75 72 |itten..A|ddResour|
|00005b50| 63 65 20 64 6f 65 73 20 | 6e 6f 74 68 69 6e 67 20 |ce does |nothing |
|00005b60| 69 6e 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |in the f|ollowing|
|00005b70| 20 63 61 73 65 73 3a 0d | 0d 09 2d 20 54 68 65 20 | cases:.|..- The |
|00005b80| 67 69 76 65 6e 20 68 61 | 6e 64 6c 65 20 69 73 20 |given ha|ndle is |
|00005b90| 4e 49 4c 20 6f 72 20 69 | 73 20 61 6c 72 65 61 64 |NIL or i|s alread|
|00005ba0| 79 20 61 20 68 61 6e 64 | 6c 65 20 74 6f 20 61 6e |y a hand|le to an|
|00005bb0| 20 65 78 69 73 74 69 6e | 67 20 0d 09 20 20 72 65 | existin|g .. re|
|00005bc0| 73 6f 75 72 63 65 2e 20 | 20 54 68 65 20 52 65 73 |source. | The Res|
|00005bd0| 45 72 72 6f 72 20 66 75 | 6e 63 74 69 6f 6e 20 77 |Error fu|nction w|
|00005be0| 69 6c 6c 20 72 65 74 75 | 72 6e 20 74 68 65 20 72 |ill retu|rn the r|
|00005bf0| 65 73 75 6c 74 20 63 6f | 64 65 0d 09 20 20 61 64 |esult co|de.. ad|
|00005c00| 64 52 65 73 46 61 69 6c | 65 64 2e 0d 09 20 20 0d |dResFail|ed... .|
|00005c10| 09 2d 20 54 68 65 20 72 | 65 73 6f 75 72 63 65 20 |.- The r|esource |
|00005c20| 6d 61 70 20 62 65 63 6f | 6d 65 73 20 74 6f 6f 20 |map beco|mes too |
|00005c30| 6c 61 72 67 65 20 74 6f | 20 66 69 74 20 69 6e 20 |large to| fit in |
|00005c40| 6d 65 6d 6f 72 79 20 6f | 72 20 73 75 66 66 69 63 |memory o|r suffic|
|00005c50| 69 65 6e 74 20 0d 09 20 | 20 73 70 61 63 65 20 66 |ient .. | space f|
|00005c60| 6f 72 20 74 68 65 20 6d | 6f 64 69 66 69 65 64 20 |or the m|odified |
|00005c70| 72 65 73 6f 75 72 63 65 | 20 66 69 6c 65 20 63 61 |resource| file ca|
|00005c80| 6e 27 74 20 62 65 20 72 | 65 73 65 72 76 65 64 20 |n't be r|eserved |
|00005c90| 6f 6e 20 74 68 65 20 0d | 09 20 20 64 69 73 6b 2e |on the .|. disk.|
|00005ca0| 20 20 52 65 73 45 72 72 | 6f 72 20 77 69 6c 6c 20 | ResErr|or will |
|00005cb0| 72 65 74 75 72 6e 20 61 | 6e 20 61 70 70 72 6f 70 |return a|n approp|
|00005cc0| 72 69 61 74 65 20 4f 70 | 65 72 61 74 69 6e 67 20 |riate Op|erating |
|00005cd0| 53 79 73 74 65 6d 20 72 | 65 73 75 6c 74 0d 09 20 |System r|esult.. |
|00005ce0| 20 63 6f 64 65 2e 0d 09 | 20 20 0d 28 77 61 72 6e | code...| .(warn|
|00005cf0| 69 6e 67 29 0d 09 41 64 | 64 52 65 73 6f 75 72 63 |ing)..Ad|dResourc|
|00005d00| 65 20 64 6f 65 73 6e 27 | 74 20 76 65 72 69 66 79 |e doesn'|t verify|
|00005d10| 20 77 68 65 74 68 65 72 | 20 74 68 65 20 72 65 73 | whether| the res|
|00005d20| 6f 75 72 63 65 20 49 44 | 20 79 6f 75 27 76 65 0d |ource ID| you've.|
|00005d30| 09 70 61 73 73 65 64 20 | 69 73 20 61 6c 72 65 61 |.passed |is alrea|
|00005d40| 64 79 20 61 73 73 69 67 | 6e 65 64 20 74 6f 20 61 |dy assig|ned to a|
|00005d50| 6e 6f 74 68 65 72 20 72 | 65 73 6f 75 72 63 65 20 |nother r|esource |
|00005d60| 6f 66 20 74 68 65 20 0d | 09 73 61 6d 65 20 74 79 |of the .|.same ty|
|00005d70| 70 65 3b 20 62 65 20 73 | 75 72 65 20 74 6f 20 63 |pe; be s|ure to c|
|00005d80| 61 6c 6c 20 55 6e 69 71 | 75 65 49 44 20 62 65 66 |all Uniq|ueID bef|
|00005d90| 6f 72 65 20 61 64 64 69 | 6e 67 20 61 20 0d 09 72 |ore addi|ng a ..r|
|00005da0| 65 73 6f 75 72 63 65 2e | 0d 09 0d 0d 5c 20 52 6d |esource.|....\ Rm|
|00005db0| 76 65 52 65 73 6f 75 72 | 63 65 0d 31 0d 50 52 4f |veResour|ce.1.PRO|
|00005dc0| 43 45 44 55 52 45 20 52 | 6d 76 65 52 65 73 6f 75 |CEDURE R|mveResou|
|00005dd0| 72 63 65 20 28 74 68 65 | 52 65 73 6f 75 72 63 65 |rce (the|Resource|
|00005de0| 3a 20 48 61 6e 64 6c 65 | 29 3b 0d 0d 47 69 76 65 |: Handle|);..Give|
|00005df0| 6e 20 61 20 68 61 6e 64 | 6c 65 20 74 6f 20 61 20 |n a hand|le to a |
|00005e00| 72 65 73 6f 75 72 63 65 | 20 69 6e 20 74 68 65 20 |resource| in the |
|00005e10| 63 75 72 72 65 6e 74 20 | 72 65 73 6f 75 72 63 65 |current |resource|
|00005e20| 20 66 69 6c 65 2c 20 52 | 6d 76 65 52 65 73 6f 75 | file, R|mveResou|
|00005e30| 72 63 65 0d 72 65 6d 6f | 76 65 73 20 74 68 65 20 |rce.remo|ves the |
|00005e40| 72 65 73 6f 75 72 63 65 | 20 72 65 66 65 72 65 6e |resource| referen|
|00005e50| 63 65 20 74 6f 20 74 68 | 65 20 72 65 73 6f 75 72 |ce to th|e resour|
|00005e60| 63 65 2e 20 20 54 68 65 | 20 72 65 73 6f 75 72 63 |ce. The| resourc|
|00005e70| 65 20 64 61 74 61 20 77 | 69 6c 6c 20 0d 62 65 20 |e data w|ill .be |
|00005e80| 72 65 6d 6f 76 65 64 20 | 66 72 6f 6d 20 74 68 65 |removed |from the|
|00005e90| 20 72 65 73 6f 75 72 63 | 65 20 66 69 6c 65 20 77 | resourc|e file w|
|00005ea0| 68 65 6e 20 74 68 65 20 | 66 69 6c 65 20 69 73 20 |hen the |file is |
|00005eb0| 75 70 64 61 74 65 64 2e | 20 0d 0d 28 6e 6f 74 65 |updated.| ..(note|
|00005ec0| 29 0d 09 52 6d 76 65 52 | 65 73 6f 75 72 63 65 20 |)..RmveR|esource |
|00005ed0| 64 6f 65 73 6e 27 74 20 | 72 65 6c 65 61 73 65 20 |doesn't |release |
|00005ee0| 74 68 65 20 6d 65 6d 6f | 72 79 20 6f 63 63 75 70 |the memo|ry occup|
|00005ef0| 69 65 64 20 62 79 20 74 | 68 65 20 0d 09 72 65 73 |ied by t|he ..res|
|00005f00| 6f 75 72 63 65 20 64 61 | 74 61 3b 20 74 6f 20 64 |ource da|ta; to d|
|00005f10| 6f 20 74 68 61 74 2c 20 | 63 61 6c 6c 20 74 68 65 |o that, |call the|
|00005f20| 20 4d 65 6d 6f 72 79 20 | 4d 61 6e 61 67 65 72 20 | Memory |Manager |
|00005f30| 0d 09 70 72 6f 63 65 64 | 75 72 65 20 44 69 73 70 |..proced|ure Disp|
|00005f40| 6f 73 48 61 6e 64 6c 65 | 20 61 66 74 65 72 20 63 |osHandle| after c|
|00005f50| 61 6c 6c 69 6e 67 20 52 | 6d 76 65 52 65 73 6f 75 |alling R|mveResou|
|00005f60| 72 63 65 2e 20 0d 09 0d | 49 66 20 74 68 65 20 72 |rce. ...|If the r|
|00005f70| 65 73 50 72 6f 74 65 63 | 74 65 64 20 61 74 74 72 |esProtec|ted attr|
|00005f80| 69 62 75 74 65 20 66 6f | 72 20 74 68 65 20 72 65 |ibute fo|r the re|
|00005f90| 73 6f 75 72 63 65 20 69 | 73 20 73 65 74 20 6f 72 |source i|s set or|
|00005fa0| 20 69 66 20 74 68 65 20 | 67 69 76 65 6e 20 0d 68 | if the |given .h|
|00005fb0| 61 6e 64 6c 65 20 69 73 | 6e 27 74 20 61 20 68 61 |andle is|n't a ha|
|00005fc0| 6e 64 6c 65 20 74 6f 20 | 61 20 72 65 73 6f 75 72 |ndle to |a resour|
|00005fd0| 63 65 20 69 6e 20 74 68 | 65 20 63 75 72 72 65 6e |ce in th|e curren|
|00005fe0| 74 20 72 65 73 6f 75 72 | 63 65 20 66 69 6c 65 2c |t resour|ce file,|
|00005ff0| 20 0d 52 6d 76 65 20 52 | 65 73 6f 75 72 63 65 20 | .Rmve R|esource |
|00006000| 77 69 6c 6c 20 64 6f 20 | 6e 6f 74 68 69 6e 67 20 |will do |nothing |
|00006010| 61 6e 64 20 74 68 65 20 | 52 65 73 45 72 72 6f 72 |and the |ResError|
|00006020| 20 66 75 6e 63 74 69 6f | 6e 20 77 69 6c 6c 20 72 | functio|n will r|
|00006030| 65 74 75 72 6e 20 74 68 | 65 20 0d 72 65 73 75 6c |eturn th|e .resul|
|00006040| 74 20 63 6f 64 65 20 72 | 6d 76 52 65 73 46 61 69 |t code r|mvResFai|
|00006050| 6c 65 64 2e 20 0d 0d 0d | 5c 20 55 70 64 61 74 65 |led. ...|\ Update|
|00006060| 52 65 73 46 69 6c 65 0d | 31 0d 50 52 4f 43 45 44 |ResFile.|1.PROCED|
|00006070| 55 52 45 20 55 70 64 61 | 74 65 52 65 73 46 69 6c |URE Upda|teResFil|
|00006080| 65 20 28 72 65 66 4e 75 | 6d 3a 20 49 4e 54 45 47 |e (refNu|m: INTEG|
|00006090| 45 52 29 3b 0d 0d 47 69 | 76 65 6e 20 74 68 65 20 |ER);..Gi|ven the |
|000060a0| 72 65 66 65 72 65 6e 63 | 65 20 6e 75 6d 62 65 72 |referenc|e number|
|000060b0| 20 6f 66 20 61 20 72 65 | 73 6f 75 72 63 65 20 66 | of a re|source f|
|000060c0| 69 6c 65 2c 20 55 70 64 | 61 74 65 52 65 73 46 69 |ile, Upd|ateResFi|
|000060d0| 6c 65 20 64 6f 65 73 20 | 74 68 65 20 0d 66 6f 6c |le does |the .fol|
|000060e0| 6c 6f 77 69 6e 67 3a 0d | 0d 09 2d 20 43 68 61 6e |lowing:.|..- Chan|
|000060f0| 67 65 73 2c 20 61 64 64 | 73 2c 20 6f 72 20 72 65 |ges, add|s, or re|
|00006100| 6d 6f 76 65 73 20 72 65 | 73 6f 75 72 63 65 20 64 |moves re|source d|
|00006110| 61 74 61 20 69 6e 20 74 | 68 65 20 66 69 6c 65 20 |ata in t|he file |
|00006120| 61 73 20 61 70 70 72 6f | 70 72 69 61 74 65 0d 09 |as appro|priate..|
|00006130| 20 20 74 6f 20 6d 61 74 | 63 68 20 74 68 65 20 6d | to mat|ch the m|
|00006140| 61 70 2e 20 20 52 65 6d | 65 6d 62 65 72 20 74 68 |ap. Rem|ember th|
|00006150| 61 74 20 63 68 61 6e 67 | 65 64 20 72 65 73 6f 75 |at chang|ed resou|
|00006160| 72 63 65 20 64 61 74 61 | 20 69 73 20 77 72 69 74 |rce data| is writ|
|00006170| 74 65 6e 20 0d 09 20 20 | 6f 75 74 20 6f 6e 6c 79 |ten .. |out only|
|00006180| 20 69 66 20 79 6f 75 20 | 63 61 6c 6c 65 64 20 43 | if you |called C|
|00006190| 68 61 6e 67 65 64 52 65 | 73 6f 75 72 63 65 20 28 |hangedRe|source (|
|000061a0| 61 6e 64 20 74 68 65 20 | 63 61 6c 6c 20 77 61 73 |and the |call was|
|000061b0| 0d 09 20 20 73 75 63 63 | 65 73 73 66 75 6c 29 3b |.. succ|essful);|
|000061c0| 20 69 66 20 79 6f 75 20 | 64 69 64 2c 20 74 68 65 | if you |did, the|
|000061d0| 20 72 65 73 6f 75 72 63 | 65 20 64 61 74 61 20 77 | resourc|e data w|
|000061e0| 69 6c 6c 20 62 65 20 77 | 72 69 74 74 65 6e 20 6f |ill be w|ritten o|
|000061f0| 75 74 0d 09 20 20 77 69 | 74 68 20 57 72 69 74 65 |ut.. wi|th Write|
|00006200| 52 65 73 6f 75 72 63 65 | 2e 0d 09 20 20 0d 09 2d |Resource|... ..-|
|00006210| 20 43 6f 6d 70 61 63 74 | 73 20 74 68 65 20 72 65 | Compact|s the re|
|00006220| 73 6f 75 72 63 65 20 66 | 69 6c 65 2c 20 63 6c 6f |source f|ile, clo|
|00006230| 73 69 6e 67 20 75 70 20 | 61 6e 79 20 65 6d 70 74 |sing up |any empt|
|00006240| 79 20 73 70 61 63 65 20 | 63 72 65 61 74 65 64 20 |y space |created |
|00006250| 0d 09 20 20 77 68 65 6e | 20 61 20 72 65 73 6f 75 |.. when| a resou|
|00006260| 72 63 65 20 77 61 73 20 | 72 65 6d 6f 76 65 64 20 |rce was |removed |
|00006270| 6f 72 20 6d 61 64 65 20 | 6c 61 72 67 65 72 2e 20 |or made |larger. |
|00006280| 20 28 49 66 20 74 68 65 | 20 73 69 7a 65 20 6f 66 | (If the| size of|
|00006290| 20 61 0d 09 20 20 63 68 | 61 6e 67 65 64 20 72 65 | a.. ch|anged re|
|000062a0| 73 6f 75 72 63 65 20 69 | 73 20 67 72 65 61 74 65 |source i|s greate|
|000062b0| 72 20 74 68 61 6e 20 69 | 74 73 20 6f 72 69 67 69 |r than i|ts origi|
|000062c0| 6e 61 6c 20 73 69 7a 65 | 20 69 6e 20 74 68 65 20 |nal size| in the |
|000062d0| 72 65 73 6f 75 72 63 65 | 20 0d 09 20 20 66 69 6c |resource| .. fil|
|000062e0| 65 2c 20 69 74 27 73 20 | 77 72 69 74 74 65 6e 20 |e, it's |written |
|000062f0| 61 74 20 74 68 65 20 65 | 6e 64 20 6f 66 20 74 68 |at the e|nd of th|
|00006300| 65 20 66 69 6c 65 20 72 | 61 74 68 65 72 20 74 68 |e file r|ather th|
|00006310| 61 6e 20 61 74 20 69 74 | 73 0d 09 20 20 6f 72 69 |an at it|s.. ori|
|00006320| 67 69 6e 61 6c 20 6c 6f | 63 61 74 69 6f 6e 3b 20 |ginal lo|cation; |
|00006330| 74 68 65 20 73 70 61 63 | 65 20 6f 63 63 75 70 69 |the spac|e occupi|
|00006340| 65 64 20 62 79 20 74 68 | 65 20 6f 72 69 67 69 6e |ed by th|e origin|
|00006350| 61 6c 20 69 73 20 74 68 | 65 6e 20 0d 09 20 20 63 |al is th|en .. c|
|00006360| 6f 6d 70 61 63 74 65 64 | 2e 29 20 20 55 70 64 61 |ompacted|.) Upda|
|00006370| 74 65 52 65 73 46 69 6c | 65 20 64 6f 65 73 6e 27 |teResFil|e doesn'|
|00006380| 74 20 63 6c 6f 73 65 20 | 75 70 20 61 6e 79 20 65 |t close |up any e|
|00006390| 6d 70 74 79 20 73 70 61 | 63 65 0d 09 20 20 63 72 |mpty spa|ce.. cr|
|000063a0| 65 61 74 65 64 20 77 68 | 65 6e 20 61 20 72 65 73 |eated wh|en a res|
|000063b0| 6f 75 72 63 65 20 69 73 | 20 6d 61 64 65 20 73 6d |ource is| made sm|
|000063c0| 61 6c 6c 65 72 2e 0d 09 | 20 20 0d 09 2d 20 57 72 |aller...| ..- Wr|
|000063d0| 69 74 65 73 20 6f 75 74 | 20 74 68 65 20 72 65 73 |ites out| the res|
|000063e0| 6f 75 72 63 65 20 6d 61 | 70 20 6f 66 20 74 68 65 |ource ma|p of the|
|000063f0| 20 72 65 73 6f 75 72 63 | 65 20 66 69 6c 65 2c 20 | resourc|e file, |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.